Subject: Re: Alternative approach for interface events
To: None <tech-net@NetBSD.org>
From: Peter Postma <peter@pointless.nl>
List: tech-net
Date: 09/21/2004 09:46:43
On Mon, Sep 20, 2004 at 03:03:24PM -0700, Jason Thorpe wrote:
> 
> On Sep 20, 2004, at 1:21 PM, Peter Postma wrote:
> 
> >Ok, here's a port of FreeBSD's eventhandler (and cleaned up).
> 
> Aside from whether or not I like this API (I have to study it some 
> more), here are some comments on the patch:
> 
> 1. eventhandler_init() is unnecessary.  Statically initialize 
> eventhandler_lists and eventhandler_slock instead.
> 

Ok, will fix this.

> 2. What are the interrupt semantics of event handlers?  EHL_LOCK() and 
> EHL_UNLOCK() operate as if events can only be issued from a valid 
> thread context, never from an interrupt context (otherwise, they would 
> need some interrupt projection, as well).
> 

It's not the intention to call it from an interrupt context. Some places
to put EVENTHANDLER_INVOKE would be where currently pfil_run_hooks() is
called to note about interface changes.

-- 
Peter Postma