Quantcast

EVENTHANDLER()'s

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

EVENTHANDLER()'s

John Baldwin
So many years ago (2004), you removed support for "fast" EVENTHANDLER()
objects.  I was looking at this today and I kind of think we should actually
undo that, but perhaps instead what we should do is make all EVENTHANDLER()'s
"fast".  No one creates eventhandlers with dynamic names (nor have they ever
AFAIK), they all have static names.  However, each time someone calls
EVENTHANDLER_INVOKE() we do an O(n) loop with strcmp's to lookup the list by
it's name via a string.  It seems to me that we would do just fine with having
all the eventhandler lists be global variables like the old "fast" variants
and the string "tag" passed to all the EVENTHANDLER macros would just be used
to set the variable name (exactly like the old "fast" variants).  This would
remove all the O(n) lookups, and we could further optimize _INVOKE() to not do
any locking if the list is empty to avoid overhead in the case where there are
no active hooks.

--
John Baldwin
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: EVENTHANDLER()'s

Poul-Henning Kamp
In message <[hidden email]>, John Baldwin writes:

You are probably right.

--
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
[hidden email]         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "[hidden email]"
Loading...