[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Is there's some information for use Lua in Multi-threaded C++ Application?
- From: Michael Bernstein <michael@...>
- Date: Tue, 12 Aug 2003 10:36:44 -0400
On Tuesday, August 12, 2003, at 08:45 AM, Phipps Xue wrote:
I's there any information about developing a multi-threaded c++
application, which will call lua script in each thread?
My demo programm could dance very well in single thread but crashed
I copy the same code snippet in a programm has one main thread and one
Xue Jianmin, Phipps
Are you creating a new instance of the lua interpreter for each thread?
From what I understand, you need to create independent instances of
the interpreter. Most likely, you realize this and are doing so.
however, there could be a conflict based on the snippet you have
chosen. What I would recommend is to write a small snippet that really
doesn't do anything except open a lua script and grab a few variable
values, and then print them to stderr or wherever you wish, and fork 3
or 4 times and have it test this....once you succeed at that, you know
it's not an issue with your lua calls. However, if that fails, send
another post with the code attached or whatnot for the simple test and
we collectively can see where there could be a problem.
"Until they become conscious they will never rebel, and until after
they have rebelled they cannot become conscious"
--George Orwell, 1984