Re: ANN: Etiquette: a protocol construction tool
Eugene Zaikonnikov <[email protected]> Fri, 19 Sep 2003 17:41:02 +0300
| Newsgroups | gmane.lisp.clump |
|---|---|
| Message-ID | <[email protected]> |
* "Peter" == Peter Seibel <[email protected]> writes: Peter> Another variant (which worked quite successfully in a message Peter> processing system I worked on in Java) is to use a fixed Peter> number of threads to provide an asynchronous interface to Peter> things that are fundamentally blocking. Thus you have one Peter> thread devoted to running your state machines (or possibly N Peter> threads, where N is the number of CPU's in your machine) and Peter> then you use one thread to deal with each place you have to Peter> blocking i/o. For instance, if you don't have select(), either Peter> because it's not exposed up through Lisp or because the OS Peter> implements it badly[1], or because you're dealing with some Peter> other API that doesn't expose itself as a filehandle, such as Peter> doing queries against a database, you can instead spin up a Peter> thread that accepts requests to do i/o on a queue and does the Peter> i/o as fast as it can. This is actually an important point: in general we can't rely that the underlying transport will use pollable machinery. So it seems there is a number of ways how lightweight multiplexing of protocols can be achieved. I'll need to study the issue more thoroughly. But from the responses I see that this feature is desirable, hence it is now placed on my to-do list. -- Eugene