From: Aureliano Buendia Date: 2006-11-10T02:09:20+09:00 Subject: Ruby and threads: a VTK example Hi, There is a ruby wrapper available for vtk which works, more or less, fine. For those who are not familiar with vtk, it is avisualisation library written in c++ and the output is a native window showing some interactive OpenGL graphics. The VTK code usually ends with: iren = Vtk::RenderWindowInteractor.new iren.start() Here is where the problem comes: iren.start() starts a new thread in c++, while, I am trying to run the script in irb and interactively change the objects properties and see the live results in the OpenGL window. Unfortunately, after iren.start() ruby goes to a deep sleep. This is the irb output: >> ?> iren.Start() which obviously does not let me to enter any more commands unless I close the window: => nil >> which is too late for manipulating objects interactively. It is surprising when a multi-threaded c++ library is single-threaded after wrapping to ruby. If this does something have to do with ruby not supporting native threads, perhaps it is a big sacrifice for portability. What is the best way to have irb command line, while also having the graphics rendering window? -- Posted via http://www.ruby-forum.com/.