Subject: Re: Proposal for generic kernel event framework
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: Nathan J. Williams <nathanw@MIT.EDU>
List: tech-kern
Date: 01/26/1999 14:17:46
Jason Thorpe <thorpej@nas.nasa.gov> writes:
> void kevent_server_destroy(struct kevent_server *ksrvr);
>
> This function destroys an event server. If the server still has
> clients bound to it, the server becomes `orphaned'. This allows
> a detaching subsystem to notify all clients that it has gone away,
> but allows the clients to detach from the server at their leisure.
How do clients get notified that the server has gone away? Is
there a special kevent_message that means "Server has detached"? Or
should there be another call, say kevent_client_status(), that tests
whether a server for a particular client exists?
> Once the last client reference is gone, the kevent_server structure
> will be freed back to the system.
>
>
> int kevent_client_create(const char *name,
> void (*func)(void *arg, const struct kevent_message *kmsg),
> void *arg, struct kevent_client **kclntpp);
It occurs to me that a some part of the kernel might want to
listen for multiple types of events with the same callback
function. The opaque arg could be used (somewhat awkwardly) to
distinguish the different calls, but it might be worth considering
adding the name of the server that send the message to either the
callback arguments or the kevent_message structure.
I'm also not sure what-all in the kernel would be covered by
this system, but for some applications it might be worthwhile to have
a server that is simply a collection of other servers. In that case,
it might additionally be useful to pass the name of the server that a
message was sent from, as well as the server that it was delivered
through.
Just some thoughts.
- Nathan