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

2013-12-27 Thread Marin Ramesa
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_t, chain) { > + > + simple_lock(&futex->futex_wait_lock); > + > +

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

2013-12-27 Thread Richard Braun
On Fri, Dec 27, 2013 at 10:23:01PM +0100, Marin Ramesa wrote: > On 12/27/2013 09:58:07 PM, Richard Braun wrote: > >Do you mean you're expecting kalloc() to actually work in a POSIX > >environment ? > > I expected it to work on Hurd running gnumach, but I don't understand > what it means to functio

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

2013-12-27 Thread Marin Ramesa
On 12/27/2013 09:58:07 PM, Richard Braun wrote: On Fri, Dec 27, 2013 at 07:55:02PM +0100, Marin Ramesa wrote: > On 12/27/2013 07:14:40 PM, Richard Braun wrote: > >What do you mean when you say you test on the Hurd and Linux ? How do > >you use GDB with Mach to determine it's actually kalloc th

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

2013-12-27 Thread Richard Braun
On Fri, Dec 27, 2013 at 07:55:02PM +0100, Marin Ramesa wrote: > On 12/27/2013 07:14:40 PM, Richard Braun wrote: > >What do you mean when you say you test on the Hurd and Linux ? How do > >you use GDB with Mach to determine it's actually kalloc thta > >segfaults ? > > I link it with gnumach .o file

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

2013-12-27 Thread Ivan Shmakov
> Richard Braun writes: > On Fri, Dec 27, 2013 at 04:28:33PM +0100, Marin Ramesa wrote: […] >> +static futex_hash_table_t table = NULL; >> +static unsigned int max_hash_val = 0; > I strongly recommend using the module namespace for everything > global, including static variables an

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

2013-12-27 Thread Marin Ramesa
On 12/27/2013 07:14:40 PM, Richard Braun wrote: On Fri, Dec 27, 2013 at 04:28:33PM +0100, Marin Ramesa wrote: > On Hurd tests fail with a segmentation fault in kalloc() (GDB says kalloc() > segfaults in vm_map_find_entry()). On Linux everything works except segfaults > in vm_map_lookup(), ass

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

2013-12-27 Thread Richard Braun
On Fri, Dec 27, 2013 at 04:28:33PM +0100, Marin Ramesa wrote: > On Hurd tests fail with a segmentation fault in kalloc() (GDB says kalloc() > segfaults in vm_map_find_entry()). On Linux everything works except segfaults > in vm_map_lookup(), assert_wait(), thread_block() and kalloc() that are to be

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

2013-12-27 Thread Marin Ramesa
Queue functions and macros are used to implement generic doubly-linked lists. New structure futex_thread is defined since vm_map_lookup() is now per-thread. Functions assert_wait(), thread_block(), thread_wakeup() and clear_wait() are now used instead of thread_suspend() and thread_resume(). New fi