bug-hurd
[Top][All Lists]
Advanced

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

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


From: Marin Ramesa
Subject: Re: [RFC] kern: simple futex for gnumach (version 6)
Date: Sat, 28 Dec 2013 13:29:06 +0100

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 event. When another thread wakes the futex, it walks the list
of futex_waiters, and for each of them, wakes up the associated thread.
No need to count anything here, just a simple list to walk, and no
need to have distinct cases between cross address space wakeups or not.
What makes a futex cross address space is simply that its a non first
class kernel object, just like ports, referenced with a (map, address)
pair. Once in the kernel, it's merely a wait queue.

You're right. I will rewrite it that way. I will just keep clear_wait()
paired with thread_sleep() so I don't have to use the event. I just
unconditionaly clear assert_wait().


reply via email to

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