lua-users home
lua-l archive

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


Wim Couwenberg wrote:

Even better: what could be removed? (Half-joking :o)


My tentative list:

-  coroutines (is there *anyone* at all who agrees??  :-)  )

Ummm... probably not. Let me be another voice speaking up in defense of coroutines. Our application initially made heavy use of preemptive multithreading and a single Lua universe. We found that we wound up spending a *lot* of time in mutex (un)lock calls. This penalty outweighed the purported benefits of preemptive multithreading. We have since moved to allowing only a single thread per Lua universe with heavy use of coroutines to handle much of our "background" processing. This has both improved the performance of our application significantly and dramatically reduced the amount of head-scratching we do about threading issues. :-) We continue to use other threads, but their use is now restricted to CPU-intensive tasks that are easily disconnected from the rest of the system.

-Eric