Managing userland data pointers in kqueue/kevent
Julian Elischer
julian at freebsd.org
Mon Nov 15 19:37:23 UTC 2010
On 11/15/10 10:38 AM, Paul LeoNerd Evans wrote:
> On Mon, Nov 15, 2010 at 10:33:25AM -0800, Julian Elischer wrote:
>> it was provided for pretty much what you are using it for, so that
>> the userland caller could
>> easily associate the returning event with some private information
>> about the event.
> This was indeed the impression I got. With reference to my original
> questions regarding its use, perhaps you could suggest some way to
> actually use this API then, in order to solve my problem?
>
> Unless there's some subtle detail or trick I have misunderstood, it
> doesn't appear to be easily possible in this manner.
>
> How would you suggest I manage these pointers and data structures?
>
I don't think it was thought of in the context of reference counted items.
you could use an ever increasing number that you hash on a hash table.
if the kernel returns a number that is out of date you won't find it
and you
can ignore it. If the kernel returns a number you are currently tracking.
then you use the item associated with that entry.
More information about the freebsd-hackers
mailing list