[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] kern: simple futex for gnumach (version 10)
From: |
Richard Braun |
Subject: |
Re: [RFC] kern: simple futex for gnumach (version 10) |
Date: |
Mon, 6 Jan 2014 15:00:35 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Jan 06, 2014 at 12:34:32PM +0100, Richard Braun wrote:
> > +static struct rbtree futex_tree;
>
> http://lists.gnu.org/archive/html/bug-hurd/2013-12/msg00545.html :
> "Personally, I'd use a per-task red-black tree".
> ^^^^^^^^
>
> http://lists.gnu.org/archive/html/bug-hurd/2013-12/msg00546.html :
> "To finish with, the more I think about it, the less I understand why
> there is a need for futex objects in the first place. Instead of
> dynamically allocating such structures, it probably makes more sense
> to use the addresses of the physical page descriptors instead."
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
After some thinking, this would actually not work, as physical pages can
be paged out. You can use a (VM object, offset) pair instead, but you
have to deal with private futexes, which should probably use a
(VM map, address) pair.
So, you actually need a global, shared container for process shared
futexes, and per-task containers for private ones. We also need to make
sure nothing bad happens to an (object, offset) pair when, say,
copy-on-write is performed by the VM system... All this looks quite
tricky to me, and certainly not a "small hack entry" :-/.
--
Richard Braun