The first kse_create call
Sergey Kosyakov
ks4usa at yahoo.com
Wed Jun 18 06:46:25 PDT 2003
--- Daniel Eischen <eischen at vigrid.com> wrote:
>
> You have to have both a thread mailbox pointer set in the
> KSE mailbox and you have to expire the quantum. The quantum
> is system plus user time. It is not real time (e.g., a nanosleep()
> does not expire quantum while it sleeps).
I'm trying to do this:
mbx.km_version=KSE_VER_0;
mbx.km_func=uc_1;
mbx.km_stack.ss_sp=stack_1;
mbx.km_stack.ss_size=SIGSTKSZ;
mbx.km_stack.ss_flags=SS_ONSTACK;
ret=getcontext(&(thr_mbx.tm_context));
printf("getcontext %d\n",ret);
thr_mbx.tm_context.uc_link=NULL;
thr_mbx.tm_context.uc_stack.ss_sp=thr_stack_1;
thr_mbx.tm_context.uc_stack.ss_size=SIGSTKSZ;
thr_mbx.tm_context.uc_stack.ss_flags=SS_ONSTACK;
makecontext(&(thr_mbx.tm_context),func,0);
thr_mbx.tm_uticks=10;
thr_mbx.tm_sticks=0;
mbx.km_curthread=&thr_mbx;
ret=kse_create(&mbx,0);
do
{
++i;
}while(1);
And never got upcall. (But if I put printf in the loop I got the
upcall).
Thanks,
Sergey.
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
More information about the freebsd-threads
mailing list