bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH] kern: simple futex for gnumach (version 4)


From: Richard Braun
Subject: Re: [PATCH] kern: simple futex for gnumach (version 4)
Date: Tue, 24 Dec 2013 11:41:40 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Dec 22, 2013 at 03:58:55PM +0100, Marin Ramesa wrote:
> +simpleroutine futex_rpc(
> +             thread          : thread_t;
> +             address         : pointer_t;
> +             value           : int;
> +             operation       : int);
> +
> +simpleroutine futex_wait_rpc(
> +             thread          : thread_t;
> +             address         : pointer_t;
> +             value           : int);
> +
> +simpleroutine futex_wake_rpc(
> +             thread          : thread_t;
> +             address         : pointer_t;
> +             thread_num      : int);

Obviously, you rushed your work without trying to understand what you
were doing, and this is becoming frustrating. Don't blindly and
mindlessly copy the first thing you see around...

1/ A simpleroutine is a one-way RPC, without a return value other than
that of the message transmission.

2/ Futex calls should operate on futexes, not threads. If you actually
only want to specify addresses in the calls, use a task_t as first
parameter, because there is no risk of right reference leak when calling
mach_task_self, whereas there are with mach_thread_self.

And again, I insist on *not* creating ioctl-style calls with an
"operation" parameter. The operation is the RPC itself. Also, AIUI, the
operations are wait and wake, so why create a third "futex" RPC ?

To finish with, don't suffix RPCs with "_rpc" ...

Personal question: why are you working on this ? Considering the
beginner mistakes you did at the C level itself, and that you've never
even run a real GNU Mach instance, what makes you think you have the
proper experience to work on such a low-level tool that involves both
virtual memory and concurrency, two of the most difficult domains in
computer science ?

-- 
Richard Braun



reply via email to

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