[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How to implement a reentrantable library?
- From: "V S P" <toreason@...>
- Date: Thu, 13 Nov 2008 06:14:38 -0500
I did not have any problems using lua from multiple threads
on a multi-cpu machine running windows .
The interface was implemented using the excellent
You must make sure that a single luastate (and therefore
all the calls that use luastate) is not used by multiple threads
at the same time, in my instance, each thread on startup was setup
to have a luastate. So the same luastate would be used by only that
So 5 threads, 5 luastates that are permanently attached to each thread.
On Thu, 13 Nov 2008 07:28:03 -0200, "Luiz Henrique de Figueiredo"
> > I want to implement a reentrantable library for Lua, and use it in the same Lua virtual machine with multiple instances. but I don't know how to do it, does anybody has same experience with it, maybe you can give me some useful tips.
> All C libraries for Lua should be reentrant. That means that they should
> rely on any global or static data. See the code for the standard Lua
> and also for instance my own libraries at
V S P
http://www.fastmail.fm - Send your email first class