lua-users home
lua-l archive

Re: Why is my thread not resuming? (very simple code inside)

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


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 LUAI_MAXCSTACK. 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.
HTH,
Bogdan

AltStyle によって変換されたページ (->オリジナル) /