[M3devel] Latest pthreads attempt

Dragiša Durić dragisha at m3w.org
Wed Aug 13 21:47:45 CEST 2014


CAS locking is exactly what is used in futexes so we have that kind of being-thin functionality at least in Linuxes. Futexes are around for more than 10yrs now so I believe it is pretty common already.

On 13 Aug 2014, at 21:40, Tony Hosking <hosking at cs.purdue.edu> wrote:

> Tough to get away with that if we wrap pthread mutexes like we do.  But yes, much cheaper on modern thread implementations.  And wrapping allows us to go to a thin-lock implementation using CAS (acquire of an uncontended mutex is simply CAS(ADR(m.holder), NIL, self).  A contended mutex can be detected by setting a low bit in the holder field.  And even better, we can implement biased locking, wherein an uncontended lock is biased towards one particular thread which can lock it without CAS.  Revoking the bias requires stopping the thread holding the bias, clearing it, and resuming.
> 
> Need more time...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20140813/9ce4e577/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20140813/9ce4e577/attachment-0002.sig>


More information about the M3devel mailing list