Thread imbalance

Neil Hodgson nyamatongwe+thunder at gmail.com
Mon Feb 6 05:46:08 EST 2006


Ivan Voras:

> I mentioned it because, as far as I know the Lua's intepreter doesn't do 
> implicit locking on its own, and if I want to run several threads of 
> pure Lua code, it's possible if I take care of data sharing and 
> synchronization myself.

    Lua's interpreter will perform synchronization if you create 
multiple threads that attach to a shared Lua state. You have to provide 
some functions for Lua to call to perform the locking.

    If you create multiple Lua states they are completely separate 
worlds and do not need to be synchronized.

    Neil



More information about the Python-list mailing list