Subject: Re: sched_yield() and relinquishing CPU
To: None <netbsd-help@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: netbsd-help
Date: 07/07/2005 01:16:05
In article <874qb8rrbj.fsf@snark.piermont.com>,
Perry E. Metzger <perry@piermont.com> wrote:
>
>christos@astron.com (Christos Zoulas) writes:
>>>You give up the CPU automatically whenever your process blocks or when
>>>you run out of your time quantum. If you want to give up the CPU
>>>earlier by intent, just block.
>>
>> Or do a system call eg. select(0, NULL, NULL, NULL, NULL);
>
>That's a way of blocking.

Yes, and it is not what I intended:

    struct tv foo = { 0, 0 };
    select(0, NULL, NULL, NULL, &tv);

This is a way to give up your quantum; you might end up being rescheduled
or not.  In my mind "blocking" usually describes "waiting for a resource
to become available"; in this case you might not actually "block" since
you are not waiting for a resource.

christos