From: Suraj Kurapati Date: 2008-03-03T14:31:46+09:00 Subject: Re: Ruby 1.9 - embedding inside a pthread Suraj Kurapati wrote: > I'm having trouble embedding Ruby 1.9 inside a pthread because calling > ruby_sysinit() is segfaulting. I created a small example to reproduce > the problem and illustrate my humble goal. (The reason for this weird > way of embedding Ruby is: I need to embed Ruby inside a Verilog HDL > simulator and this is the best way I could accomplish it!). I should clarify that although the main.c in this example has argc and argv, when I deploy my C extension as a .so file, there is no main() method as far as my code is concerned. The Verilog simulator owns the main() method and my C extension has *no* way of accessing the argc and argv passed to that main() method. For this reason, I did not pass the argc and argv from main() to the body of the gRubyThread (because that is the real-life scenario of this simple example). And since ruby_sysinit() requires an argc and argv, I am forced to fabricate them inside the body of gRubyThread. -- Posted via http://www.ruby-forum.com/.