Roger said:
Appears there's also an rb_thread_create, though I have no idea how to
use it.
http://betterlogic.com/roger/?p=2474&cpage=1#comment-3372
might work...the kicker though is that if you're looking for something
like
rb_go_and_do_this_in_some_other_thread("stuff")
Then I don't think using ruby's C API to start a thread will work--you
may need to run the ruby code in a separate C thread.
GL!
-r
Actually , I tried :
rb_funcall3(rb_const_get(rb_cObject, rb_intern("Thread")),
rb_intern("new"), 0, 0);
But >> `initialize': must be called with a block (ThreadError)
it seems like the Thread Class should always be called with a Block of
instrcution to execute as we do with Ruby Code Thread.new{ do .. this ..
ect }
I found Some C Methods to deal with Ruby Thread :
...
VALUE rb_thread_stop (void)
VALUE rb_thread_wakeup (VALUE)
VALUE rb_thread_run (VALUE)
VALUE rb_thread_kill (VALUE)
VALUE rb_thread_create (VALUE(*(ANYARGS), void *))
void rb_thread_interrupt (void)
void rb_thread_trap_eval (VALUE, int)
void rb_thread_signal_raise (char *)
int rb_thread_select (ANYARGS)
void rb_thread_wait_for (ANYARGS)
VALUE rb_thread_current (void)
VALUE rb_thread_main (void)
...
http://ruby-doc.org/doxygen/1.8.4/group__ruby__eval.html
But not yet sure that it really create and manage a Ruby Thread (
especially that this One should be always initialized with a block of
instructions )