On 6/15/06, tsuraan / tsuraan.net <tsuraan / tsuraan.net> wrote:
> > to believe that there are some "interactions" between Ruby and the C++
> > library. Also, the Ruby program runs on a different thread than the
> > C++.

> You're using ruby in its own thread.  Are you making calls into the
> ruby machine from the c++ thread?  I'm not sure how thread-safe the
> ruby-library is, but I seem to remember that it's not terribly safe.

It is definitely the case that calling into the ruby interpreter from
anything other than the interpreter thread is a "bad thing." If you
need to signal from the C++ to the Ruby you have a number of choices,
but calling any rb_XXXX functions is not one of them. I am not
familiar with SWIG's particulars, but I am guessing this means that
accessing _any_ of the ruby methods from a thread other than the
interpreter will lead to undefined behavior (here there be monsters).

pth