From: Ivan Gromov Date: 2008-05-02T03:15:27+09:00 Subject: Re: How do I embed a Ruby interpreter in my C program? Hello all. Tell me please, what initialisation order and params are required for ruby in multithreaded app, if i do not want to receive this magnificent error: =============Error================= SystemStackError: Message = stack level too deep Backtrace = from D:\_BTA\_dev\Data\Script/test.rb:7:in `print ======================================= Script: =============test.rb================= def buildHotkeysList( file1, file2 ) file1_work= File.new( file1) file2_work= File.new( file2 , "w+" ) file1_work.each_line {|line| file2_work.print( line ) } end buildHotkeysList (file1.txt, file2.txt) ======================================= In simple "for ruby" app everything is ok: =============main.cpp================= int main( int argc, char **argv ) { NtInitialize(&argc, &argv); ruby_init(); ruby_script("embed"); rb_load_protect( rb_str_new2( "Test.rb" ), 0, &status); ruby_finalize(); ruby_cleanup(0); } ======================================= Platform: Windows Compiler: Microsoft Ruby : 1.86 Thread API: ACE thread. Thank you. -- Posted via http://www.ruby-forum.com/.