Suraj Kurapati wrote:
> 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, while doing the initialization 
> inside the main thread.  See http://www.ruby-forum.com/topic/144747 for 
> examples and discussion.

Since your target platform is Win32, I'm not sure whether you have the 
pthreads library available.  So another approach would be to embed the 
*execution* of your Ruby program inside a Ruby thread 
(rb_thread_create()).  You can synchronize between the thread and your 
main C program through the use of Ruby's thread-safe Queue class.

See http://www.ruby-forum.com/topic/144747#652515 for an example.
-- 
Posted via http://www.ruby-forum.com/.