[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Coroutines and blocking IO
- From: D Burgess <dburgess@...>
- Date: Fri, 27 Jan 2006 12:11:38 +1100
The Ruby solution(the outcome) sounds exactly what Lua needs.
FYI, Adrian Sietsma has implemented a HTTP proxy server using
Luasocket and non-blocking IO. He passed NB sockets to the
existing Luasocket code and changed a few minor things. Coros
perform the IO and state management.
The proxy server (which I think is tougher to implement than a
Web Server) works rather well.
IMHO non-blocking IO or AIO on windows (no OS threads) for
IP server applications can provide high performance
scaleable applications.
DB
On 1/27/06, Jon Smirl <jonsmirl@gmail.com> wrote:
> On 1/26/06, Diego Nehab <diego@tecgraf.puc-rio.br> wrote:
> > Hi,
> >
> > > There may be no such way to get an event from a Windows "socket", though,
> > > in which case the only solution is probably to have a back-end that uses
> > > entirely native Windows APIs.
> > >
> > > When I want any level of control over files, I skip the stream functions
> > > and use low level fd access instead. Of course, that means I have to do
> > > buffering myself.
> >
> > The tough part is not to get these things to work, or even to make them
> > efficient. The problem is to come up with a simple, consistent and
> > portable interface that will make most people happy.
>
> That's what I find neat about the Ruby solution. From Ruby the IO
> looks like it is synchronous. All of the select/poll and IO thread
> logic is hidden in C code and invisible to the Ruby programmer. There
> is no Ruby API for async IO.
>
> --
> Jon Smirl
> jonsmirl@gmail.com
>