Re: [take25 1/6] kevent: Description.

From: Evgeniy Polyakov
Date: Fri Nov 24 2006 - 06:51:55 EST


On Thu, Nov 23, 2006 at 02:34:46PM -0800, Ulrich Drepper (drepper@xxxxxxxxxx) wrote:
> Hans Henrik Happe wrote:
> >I don't know if this falls under the simplification, but wouldn't there be
> >a race when reading/copying the event data? I guess this could be solved
> >with an extra user index.
>
> That's what I said, reading the value from the ring buffer structure's
> head would be racy. All this can only work for single threaded code.

Value in the userspace ring is updated each time it is changed in kernel
(when userspace calls kevent_commit()), when userspace has read its old
value it is guaranteed that requested number of events _is_ there
(although it is possible that there are more than that value).

Ulrich, why didn't you comment on previous interface, which had exactly
_one_ index exported to userspace - it is only required to add implicit
uidx and (if you prefer that way) additional syscall, since in previous
interface both waiting and commit was handled by kevent_wait() with
different parameters.

> --
> â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View,
> CA â

--
Evgeniy Polyakov
-
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/