Messages in this thread | | | Date | Tue, 4 May 1999 00:22:28 -0700 (PDT) | From | Alex Belits <> | Subject | Re: Mark Russinovich's reponse Was: [OT] Comments to WinNT Mag !! (fwd) |
| |
On Tue, 4 May 1999, Mark Christiansen wrote:
> NT's asynchronous I/O is very useful when dealing with external hardware > and something approaching real time. I would be most happy if Linux were > to support asynchronous I/O and a system call like NT's WaitForMultipleObjects(). > For those who have not done this sort of thing on NT, WaitForMultipleObjects > is like an enhanced select() which can accept files, semaphores, mutexes, the whole > range of things that a program might want to wait for and wakes the program > up as soon as one of these is ready. It allows me to write simple code which > deals efficiently with a long lists of asynchronous events.
In Linux (or any Unix) select()/poll() on anonymous pipes or local sockets does the same thing easier, except that pipes/sockets can also pass some meaningful information about "events" from the point of view of another process/thread. The high efficiency of pipes (and scheduler's handling of processes/threads that use them, that causes context switch at the right time) is probably the reason why such interface never appeared.
In my HTTP server I use this kind of mechanism as a transport between nonblocking main process and "worker" backend processes, and it seems to work well. I haven't made any precise scalability measurements (it's a web server after all -- it takes large number of clients to load it high enough to reach those limits), however I doubt that scalability of any implementation of WaitForMultipleObjects will differ from scalability of poll().
This however brings another question -- FreeBSD at some point of its evolution abandoned 4.4BSD implementation of anonymous pipes over sockets and re-adopted "classic BSD" concept of unidirectional extra-lightweight pipes (implemented with some VM-related stuff by John Dyson). Had anyone compared Linux and FreeBSD pipe implementations' efficiency?
-- Alex
---------------------------------------------------------------------- Excellent.. now give users the option to cut your hair you hippie! -- Anonymous Coward
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |