Thanks, Teemu.

Would the function start() not set t2 running the first time?

-- Nikhil

On Mon, May 11, 2009 at 11:55 PM, Teemu Koponen <[email protected]> wrote:

> On May 11, 2009, at 23:31 , Nikhil Handigol wrote:
>
>  I'm using cooperative threads in NOX to handle asynchronous SNMP calls.
>> I'm a bit worried about the possibility of a race condition in my code. Does
>> the programmer dictate the scheduling of threads in the cooperative thread
>> model?
>>
>
> Right. In co-operative threading model the programmer explicitly (by
> calling yield) or implicitly (by blocking) instructs the scheduler to run
> the next thread in the same thread group.
>
>  An easier/clearer question to answer would be the following:
>> Suppose thread t1 starts a new cooperative thread t2. Does t1 get
>> rescheduled by the processor only when t2 yields/blocks/exits?
>>
>
> Exactly right again.  Note though, the t2 won't run before t1
> yields/blocks/exits for the first time after it has created the thread t1.
>
_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org

Reply via email to