Folks, its not that simple as "use futex for PTHREAD_PROCESS_SHARED".
First, you must realize that conceptually, the N kernel threads utilized in a
M:N thread model like NGPT are virtual processors. Hence you can't simply
wait in the kernel as you would block your v-proc. Hence the current
futex interface of up and down kernel calls in not sufficient.
What is required is an asynchronous mechanism that lets a v-proc
leave a notification object <nobj> in the kernel that get's enqueued just
like every other waiting task. <nobj> ::= <v-proc, struct *futex>
When the futex is signaled and <nobj> is woken up, a scheduling event is send
to the <v-proc> or its task or its process (this has to be thought through).
This can be done through a signal or through an shared event queue or a
combination of such.
Under no circumstances can you block the <v-proc> == task on a futex !!!
I talked with Bill Abt of the NGPT team about it and he conceptually agrees
with this approach, but since the regular interface is still not hammered out
and stable, no point going after more sophisticated stuff yet.
-- -- Hubertus Franke (frankeh@watson.ibm.com) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/