[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: PIL book - OS blocking calls
- From: Javier Guerra <javier@...>
- Date: Thu, 23 Mar 2006 07:18:29 -0500
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:
pgpPbE0z4DUPl.pgp
Description: PGP signature