[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua State Thread Safety
- From: Josh Simmons <simmons.44@...>
- Date: Mon, 14 Jul 2014 10:45:45 +1000
On Mon, Jul 14, 2014 at 10:39 AM, Thiago L. <email@example.com> wrote:
> On 13/07/14 09:36 PM, Austin Einter wrote:
>> Hi All
>> Suppose I have Lua State L as a global variable in my C program.
>> If it is accessed and used by two different threads, is it required for me
>> to protect the Lua State by using a semaphore/mutex.
>> Lua State internally has a semaphore/mutex to protect itself.
>> Please let me know.
> I'm pretty sure they aren't thread-safe...
Indeed, Lua is not thread safe. You can protect access yourself or
maybe have a per-thread state depending on your needs.