lua-users home
lua-l archive

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


On Thursday 23 March 2006 6:01 am, David Given wrote:
> If you don't have these asynchronous primitives... well, life becomes
> difficult.
>
> A good example, and one that is always annoying, are the DNS functions.
> The standard DNS routines are always synchronous. This means that if
> your Lua VM calls one, your entire VM grinds to a halt until it returns.

this is the whole point of my Helper Threads Toolkit, to make writing those 
asynchronous libraries easy, using blocking primitives. (now in -r3, at 
LuaForge)

> There are a variety of ways round this, but they're all painful. One
> approach is to use a helper process to do the blocking operations, which
> then communicates with your VM via some form of IPC (we use pipes). This
> allows the helper process to block without stalling the VM. But these
> rapidly become painfully complex and error-prone.

yep, but with a small set of well chosen mechanisms it gets fairly regular for 
most scenarios.

-- 
Javier

Attachment: pgpCH5OqXkGCr.pgp
Description: PGP signature