[RFC] kern: simple futex for gnumach (version 7)

2013-12-28 Thread Marin Ramesa
Typedefs were removed. Static variables have been prefixed with futex. Code now uses the list module, but I have not been able to use list_for_each_entry(), GCC seems to optimize the loop away when there is one futex in the list. Hash table init is now a public function and renamed to *setup. Stat

Re: [RFC] kern: simple futex for gnumach (version 6)

2013-12-28 Thread Marin Ramesa
On 12/28/2013 11:52:55 AM, Richard Braun wrote: Here is how it probably should be : There should be one futex_waiter struct per thread, allocated on the stack when a thread is about to wait. That structure is then queued on the futex it's waiting for, using the address of the futex as the wakeup

Re: [RFC] kern: simple futex for gnumach (version 6)

2013-12-28 Thread Richard Braun
On Sat, Dec 28, 2013 at 02:30:01AM +0100, Marin Ramesa wrote: > On 12/27/2013 07:14:40 PM, Richard Braun wrote: > >> +void futex_cross_address_space_wake(futex_t futex, boolean_t > >wake_all) > >> +{ > >> + #define min(x, y) (x <= y ? x : y) > >> + > >> + queue_iterate(&futex->chain, futex, futex