From: Suraj Kurapati Date: 2008-05-02T23:17:40+09:00 Subject: Re: How do I embed a Ruby interpreter in my C program? Ivan Gromov wrote: > i just want to use 'ruby_init()', 'ruby_finalize()' at the main > thread. And 'rb_load_protect()' at the other thread. > Is it possible ? And how ? Yes this is possible. The trick is to embed the *execution* of Ruby interpreter inside a POSIX thread[1], while doing the initialization inside the main thread. See http://www.ruby-forum.com/topic/144747 for examples and discussion. In fact, I've used this exact technique for my Ruby-VPI project[1], which embeds Ruby inside a Verilog simulator. [1] http://ruby-vpi.rubyforge.org -- Posted via http://www.ruby-forum.com/.