lua-users home
lua-l archive

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


On 2/2/06, Chris <coderight@gmail.com> wrote:
>  "Avoid the mistake of associating the mutex with a specific Lua state."

Ahhhh. Vague terminology (in this case, the unfortunate conflation of
threads and coroutines) rears its ugly head! In context:

"All threads must share the same mutex. Avoid the mistake of
associating the mutex with a specific Lua state."

What is meant:

"All coroutines within a particular lua universe must share the same
mutex. Avoid the mistake of associating the mutex with a specific Lua
state and then failing to find it again when a different coroutine
within the same universe is locked."

If you are using both coroutines and multithreading, this gets tricky.
In your non-coroutine case, however, the practical upshot is "use a
different mutex for each universe".

Ben