Re: [patch/revised] wake_up_info() ...

From: Davide Libenzi
Date: Mon Jan 05 2004 - 16:36:57 EST


On Mon, 5 Jan 2004, Linus Torvalds wrote:

>
>
> On Mon, 5 Jan 2004, John Gardiner Myers wrote:
> >
> > It would seem better if info were a void *, to permit sending more than
> > a single unsigned long.
>
> The argument against that is that since there is basically no
> synchronization here, you can't pass a pointer to some random object. So
> by default, you should think of the cookie as "pass-by-value", ie not a
> pointer. That way there are no liveness issues: there is no issue about
> what happens to the data when the recipient is actually scheduled
> (possibly _much_ much after the actual wakeup).

An argoument in favour of the "void *" would be that there might be
situations were a little structure needs to be passed, that will be copied
by the target of the wakeup (callback) in its own data structure. But as
you said, we already do "unsigned long" -> "pointer" conversions inside
the kernel, so it does not really matter. Let's stick with the unsigned
long version then.



- Davide


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/