Only const or immutable class thread local variables are allowed

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Sun Dec 8 21:19:19 PST 2013


On Monday, 9 December 2013 at 00:24:44 UTC, Ali Çehreli wrote:
> David Simcha presented it as a D-specific pattern and explained 
> how D avoids at least one of the bugs of double-checked locking:
>
>
> http://www.youtube.com/watch?feature=player_detailpage&v=yMNMV9JlkcQ#t=1676

I will look at this in detail but instinctively based on what I 
understand a singleton to be for, I'm not sure it's what I want: 
I'm not looking for something truly global, only thread-global.

Just so you can see, this is what I've got:
https://github.com/WebDrake/std.random2/blob/master/std/random2/generator.d#L18
https://github.com/WebDrake/std.random2/blob/master/std/random2/generator.d#L688

... and this is what it's designed to replace:
https://github.com/D-Programming-Language/phobos/blob/master/std/random.d#L1148
https://github.com/D-Programming-Language/phobos/blob/master/std/random.d#L1104



More information about the Digitalmars-d-learn mailing list