lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


The main requirement to have an effective lis scheduler is having
_one_ single call to wait for _any_ kind of long operations.

Is LusSocket mechanism flexible enough to handle local sockets and file I/O?

Other blocking operations (like DB or libraries) could be handled by a
separate process, reporting via sockets. Somewhat tedious, but very
doable.



On 2/28/08, Doug Currie <doug.currie@gmail.com> wrote:
> On Thursday, February 28, 2008 Diego Nehab wrote:
>
> > Hi,
>
> >>> The assynchronous APIs present a different programming
> >>> paradigm, so it doesn't make sense to be compatible
> >>> there.
> >>
> >> Considering that Lua's threading model is cooperative and
> >> that most library operations are blocking, I don't see
> >> much benefit from an asynchronous socket API in practice.
> >> Or at least in the narrow confines of my current endeavors
> >> :)
>
> > The idea is to choke all notifications through a queue...
>
> Which could be used with a scheduler written in Lua so that threads
> waiting on socket I/O (even using APIs like accept) can relinquish the
> processor to ready threads.
>
> e
>
> --
> Doug Currie
> Londonderry, NH, USA
>
>


-- 
Javier