Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jan 2010 05:31:23 -0500 (EST)
From:      Daniel Eischen <deischen@freebsd.org>
To:        Bernard van Gastel <bvgastel@bitpowder.com>
Cc:        =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= <des@des.no>, freebsd-hackers@freebsd.org
Subject:   Re: pthread_{mutex,cond} & fifo/starvation/scheduling policy
Message-ID:  <Pine.GSO.4.64.1001210526560.28344@sea.ntplx.net>
In-Reply-To: <72CE899C-5941-4659-B922-DC65BB0CE67D@bitpowder.com>
References:  <71A129DC-68A0-46C3-956D-C8AFF1BA29E1@bitpowder.com> <86hbqifip8.fsf@ds4.des.no> <72CE899C-5941-4659-B922-DC65BB0CE67D@bitpowder.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 21 Jan 2010, Bernard van Gastel wrote:

> But the descheduling of threads if the mutex is not available is done 
> by the library. And especially the order of rescheduling of the 
> threads (thats what I'm interested in). Or am I missing something in 
> the sys/kern/sched files (btw I don't have the umtx file).

No, it's done by the kernel.  Threads block on a umtx in
the kernel, and they are also woken up by the kernel.  The
threads library does not wake up a specific thread - it
just calls into the kernel to unlock the umtx and the
kernel decides which thread to wake up.  You should probably
see src/sys/kern/kern_umtx.c.

-- 
DE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.1001210526560.28344>