Subject: Re: wsevent cleanup
To: Julio M. Merino Vidal <jmmv84@gmail.com>
From: Iain Hibbert <plunky@rya-online.net>
List: tech-kern
Date: 02/08/2006 13:37:09
On Mon, 6 Feb 2006, Julio M. Merino Vidal wrote:

> > My point then is that if you can only inject one event, the error meant
> > 'No Space' whereas if you can push several at a time, it will mean 'Not
> > Enough Space for N' which is slightly different and somewhat vague, and it
> > might be useful to be more specific with 'I injected Y', similar to how
> > write(2) works..
>
> Yes... looks like that if N > X, write(2) semantics may be better.
> But the problem with write(2) semantics, at least as I see it from
> the code I converted, is that you either need to sleep if the call
> inserts less elements than wanted (to retry later) or you have to
> rollback all the inserted events before notifying any reader.

I confess that my understanding of wsevent queue is limited, it just
struck me that there could be a crack in the pavement there..

If in fact the caller wants and must have the events injected atomically
(it seems you imply this?) then the way you have it sounds fine, though
the existence of a way to check the available space might be useful to
some.

iain