bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] Implementing a simple mutex using simple locks and futex calls


From: Richard Braun
Subject: Re: [RFC] Implementing a simple mutex using simple locks and futex calls
Date: Mon, 23 Sep 2013 11:44:01 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Sep 23, 2013 at 11:34:36AM +0200, Marin Ramesa wrote:
> On 23.09.2013 10:35:34, Richard Braun wrote:
> > Use the algorithms presented in "Futexes are tricky", I personally
> > won't accept anything less after 2010...
> 
> I do, it's actually the version from 2011. I just added the lock to the 
> mutex. 

Then read it again, and carefully please. Your code should look like
"Mutex, Take 3". You seem to use take 1.

For an actual, readable implementation based on that, see [1], which
will show you how not naive the result should be.

-- 
Richard Braun

[1] http://git.sceen.net/rbraun/x15.git/blob/HEAD:/kern/mutex.h



reply via email to

[Prev in Thread] Current Thread [Next in Thread]