lua-users home
lua-l archive

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


I'm evaluating doing some programming in lua and I've been reading
through coroutine support and things like Copas.

Lately I've been working with Ruby. Ruby definitely has a superior
solution to the blocking IO problem.  In lua you need to do
copas.receive(skt). This will cause the coroutines to schedule. In
Ruby you just do receive(skt) without needing the copas wrapper. This
is because the Ruby library converts what looks like synchronous IO
into asynchronous IO internally. Internally Ruby will do an async read
from the socket and if nothing is available it will schedule it's
threads. They have pushed the copas functionality down into the base
language library.  Ruby does this for all things that can block, not
just the network.

Has a change like this been considered for lua? I find the Ruby
solution much easier to work with.

--
Jon Smirl
jonsmirl@gmail.com