[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Why is my thread not resuming? (very simple code inside)
- From: Bogdan Harjoc <harjoc@...>
- Date: Thu, 09 Aug 2007 22:12:28 +0200
John Klimek wrote:
Is it safe to create several (hundreds?) of threads and yield/resume
each of them independantly?
Not sure what you mean by 'independently'. From a single OS thread, you
can create a few hundreds and then yield/resume one at a time. To create
more, AFAIK you have to recompile the library after increasing
To have several threads running concurrently (from different OS threads,
perhaps), I think you have to redefine 'lua_lock' and related defines.
There is a chapter in 'Programming in Lua' about non-preemptive
multithreading that may be useful to read.