Date: Mon, 26 Jun 2000 16:13:24 -0400 (EDT) From: Luoqi Chen <luoqi@watermarkgroup.com> To: jasone@canonware.com Cc: smp@FreeBSD.ORG Subject: Re: SMP meeting summary Message-ID: <200006262013.e5QKDOP09679@lor.watermarkgroup.com>
next in thread | raw e-mail | index | archive | help
> On Mon, Jun 26, 2000 at 12:46:30PM -0400, Luoqi Chen wrote: > > > Compared with the use of tsleep(), mutexes have a number of > > > advantages: > > > > > > - Each mutex has its own wait (sleep) queue. When a process releases > > > a mutex, it automatically schedules the next process waiting on the > > > queue. This is more efficient than searching a possibly very long, > > > linear sleep queue. It also avoids the flooding when multiple > > > processes get scheduled, and most of them have to go back to sleep > > > again. > > > > > What about processes of different priorities blocking for the same mutex? > > Would you do a linear search on the queue? or have the queue sorted by > > priority? or a FIFO queue is good enough? > > Processes that block on a mutex are granted the lock in FIFO order, rather > than priority order. In order to avoid priority inversion, the mutex wait > queue implements priority lending. > > Jason > Ok. I remember I have read somewhere that solaris 7 has given up the behavior of waking up only one thread after a mutex is released, now it wakes up all the blocking threads. It seems that the "thundering herd" problem is not serious after all if the lock granuity is high enough. -lq To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006262013.e5QKDOP09679>