From: Gilles Filippini Date: 2003-02-25T06:50:52+09:00 Subject: rb_thread_create / rb_thread_schedule Hello, Could somebody tell me what's wrong with the attached piece of code? A ruby thread is created before entering the interpreter's main loop. It segfault when the interpreter exits. Thanks in advance. _gilles. --%<---------------------------------- #include "ruby.h" static VALUE my_thread(void *data) { while (1) { // do something rb_thread_schedule(); } return Qtrue; } int main(argc, argv, envp) int argc; char **argv, **envp; { ruby_init(); ruby_options(argc, argv); rb_thread_create(my_thread, NULL); ruby_run(); return 0; } --%<----------------------------------