On 9/25/06, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote:
Unix is not Unix as I see...
Please note this (interesting) document:
http://developers.sun.com/solaris/articles/event_completion.html
Mostly interesting, as there is now a very powerful and scalable
notification interface on both Solaris and Mac OSX (aka BSD)
Unixes. Windows has it as well, with Linux hanging pretty much
behind (unfortunately).
I wonder if we should start making ifdefs or wrappers to be able
to benefit from the corresponding event notification interface
available on the current platform.
Mainly this would affect poll() usage in the driver thread
but can also be used all arround the code where we have to
wait for multiple "things" to happen.
Does anybody have something to comment about that?
What's the goal? We can certainly abstract socket event IO, with
poll() as a fallback. But some of the interfaces you mentioned here
can handle waiting on other things, e.g. signals. Is this what you
want?
There's a start at socket event IO in nsd/event.c. I didn't try
wrapping anything other than poll(). My main motivation was to create
a nice interface to clean up the main driver loop in nsd/driver.c, and
also to make something capable of handling the reader/writer stuff
that's in there, which is a little trickier due to the IO being spread
among more than one thread.
I have some patches for it somewhere. IIRC, the locking isn't flexible enough...
But it's code that exists so you can hack on it if you think it's suitable.
Ah yes.., why "brawe new world"? Because Unix OS is diverging
and OS vendors are adding new (incompatible) functionality
on a monthly basis. I wonder how this will all look in 10
years in future...
You'll be using Linux like every one else and it won't matter... :-)