Hi,
I have a small problem with rb_thread_create
first some example code:
···
========================================================================
static VALUE sSysServerThreadInit(MQ_PTR data)
{
MqSysServerThreadMain((struct MqSysServerThreadMainS*)data);
return rb_last_status_get();
}
static VALUE SysServerThreadCall (VALUE data) {
struct timeval sleep = {0, 200000};
VALUE ret = rb_thread_create(sSysServerThreadInit, VAL2PTR(data));
rb_thread_wait_for(sleep);
return ret;
}
the problem is that it is not guaranteed that "rb_thread_create" will
call the thread initialization code "sSysServerThreadInit".
I need a sleep for at least "200000" usec after the "rb_thread_create".
I think it is not good to have a fix waiting time because this is
system or processor dependent.
question:
why does the "rb_thread_create" not call the "sSysServerThreadInit"
proper?
thanks for help
mfg, Andreas Otto