On Sun, Sep 22, 2013 at 10:28:47AM +0200, Marin Ramesa wrote: > On 22.09.2013 02:08:41, Richard Braun wrote: > > Also, futex_wait_lock looks to be local to futex_wait... > > Yes it is. But if I introduce a more global lock that should imply that > there is another operation that is a candidate for being protected by > the lock. Which one would that be? Or you had something else in > mind ... ?
If it stays this way, the lock just doesn't protect anything... Not to mention the lock isn't even initialized at all. I guess for a first attempt, protecting the global hash table Samuel mentioned, and each futex instance with their own lock, should do. But if we need to explain that, it might be a sign that you need more experience on the subject. Maybe try a userspace proof of concept based on the algorithms presented in "Futexes are tricky" first. This would also allow more complete testing since simple locks are noops in GNU Mach. -- Richard Braun