W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2008

[whatwg] WebWorkers vs. Threads

From: Shannon <shannon@arc.net.au>
Date: Tue, 12 Aug 2008 19:51:55 +1000
Message-ID: <48A15D3B.4090401@arc.net.au>

>>
>>
>> --http://lua-users.org/wiki/CoroutinesTutorial
>>
>> Is this description incorrect? It seems at odds with what you said
>> about Lua coroutines getting an OS thread (if one is available).
>
> The description you quoted from lua-users.org is correct.  The primary 
> implementation of Lua is 100% portable ISO C, it therefore does _not_ 
> use OS threads for coroutines.  I think there may be 
> extensions/modifications produced by other parties that provide that.
>
> David Jones
> Ravenbrook Limited
>
Sorry about the misinformation. I've been working on Lua programs with 
thousands of coroutines running and never noticed any artifacts or 
delays to indicate the execution wasn't truly parallel. What I don't 
understand is why it doesn't appear to block other coroutines on IO but 
since that's not relevant to creating threaded workers I'll leave that 
mystery for future research.

I thought Lua had an implementation of automated locking to use as a 
reference but since it doesn't I have nothing more to offer on the 
subject. Without knowing the internals of existing JS implementations I 
have no idea what would be involved to provide automated locking and 
whether it is impossible or just difficult.

Shannon



 
Received on Tuesday, 12 August 2008 02:51:55 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:04 UTC