IIRC (maybe this has changed recently) atomic increments in core.atomic are based on CAS instructions in a while loop, which is how more generic lock free primitives are made. Atomic increment should be special cased to directly use lock; inc [someRegister];. <br>
<br><div class="gmail_quote">On Fri, Aug 27, 2010 at 10:40 AM, Sean Kelly <span dir="ltr"><<a href="mailto:sean@invisibleduck.org">sean@invisibleduck.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Aug 27, 2010, at 7:11 AM, David Simcha wrote:<br>
><br>
>><br>
>> I see you have some CAS instructions. Sean, I think it's a good time to collaborate with David to put them into druntime or std.concurrency.<br>
><br>
> Yeah, D needs a real atomics library. core.atomic is a good start, but I won't use it until it can efficiently do things like atomic increment.<br>
<br>
</div>How could it be made more efficient?<br>
<div><div></div><div class="h5">_______________________________________________<br>
phobos mailing list<br>
<a href="mailto:phobos@puremagic.com">phobos@puremagic.com</a><br>
<a href="http://lists.puremagic.com/mailman/listinfo/phobos" target="_blank">http://lists.puremagic.com/mailman/listinfo/phobos</a><br>
</div></div></blockquote></div><br>