Atomic updates

ixid nuaccount at gmail.com
Tue Jan 22 10:40:11 PST 2013


On Monday, 21 January 2013 at 20:35:16 UTC, bearophile wrote:
> qznc:
>
>> Code: http://dpaste.dzfl.pl/e6615a53
>>
>> Any comments or improvements?
>
> I have reformatted your code a little, according to the style 
> used in all other D entries of RosettaCode:
>
> http://codepad.org/ceDyQ8lE
>
> The usage of a sink for toString() isn't common, but it's OK.
>
> I suggest to add something to make it stop after 20 seconds or 
> so (I run all the rosettacode entries every so often to test 
> them, so I prefer them to not go on forever. Some entries are 
> required to produce infinite loops, but I think this time it's 
> not necessary).
>
>
>> I actually implemented a more scalable version than most of 
>> the other languages used, by using a lock per item instead of 
>> a single lock for the whole array.
>
> Then I suggest you to add this comment before the entry.
>
> Bye,
> bearophile

I note you always seem to use "in" in your functions and on 
reddit seemed to imply that this was the idiomatic way of using D 
yet I recall Jonathan M Davies posting that using "in" was a bad 
idea.


More information about the Digitalmars-d-learn mailing list