Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Oct 2000 13:27:52 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        John Baldwin <jhb@FreeBSD.ORG>, Daniel Eischen <eischen@vigrid.com>, arch@FreeBSD.ORG, Alfred Perlstein <bright@wintelcom.net>, Mark Murray <mark@grondar.za>, Jake Burkholder <jburkhol@home.com>, Boris Popov <bp@butya.kz>, freebsd-smp@FreeBSD.ORG
Subject:   Re: Mutexes and semaphores
Message-ID:  <20001007132752.A28665@wantadilla.lemis.com>
In-Reply-To: <200009251938.MAA29311@usr02.primenet.com>; from tlambert@primenet.com on Mon, Sep 25, 2000 at 07:38:22PM %2B0000
References:  <20001005113139.C27736@fw.wintelcom.net> <200010052142.OAA15421@usr05.primenet.com> <XFMail.000925100353.jhb@FreeBSD.org> <200009251938.MAA29311@usr02.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, 25 September 2000 at 19:38:22 +0000, Terry Lambert wrote:
>>> If we are going to support recursive mutex, I think it would be
>>> better to add separate calls/macros/data types to support them,
>>> so the the mtx mutexes can be simplified.  Calls to mtx_enter
>>> with the recursive mutex type wouldn't even compile.
>>
>> Err, the recursive nature of the mutexes is very trivial.  It
>> doesn't affect the complexity of the mutexes at all.
>
> Yes, it does.  Ownership precludes hand-off.  Recusrion support
> implies permission and tacit approval.
>
> A mutex is not recursive.  There are things you simply can not
> implement when recursion is permitted for all of your primitives.
>
> The most obvious argument is still that a mutex is intended to
> protect data, not code.  Recursion is only required if the mutex
> is actually protecting reentrancy of code, not access to data.

On Thursday,  5 October 2000 at 21:42:28 +0000, Terry Lambert wrote:
>>> There is another problem; printf's inside a kthread corrupt like
>>> crazy. They look very unthreadsafe.
>>
>> do NOT use printf without Giant.
>
> This strikes me as being rather inane.
>
> If printf won't work without holging the lock, then it damn well
> should acquire the lock if it isn't already held, and release it
> if it acquired it, before returning.

Make up your mind.

Greg
--
Finger grog@lemis.com for PGP public key
See complete headers for address and phone numbers


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?20001007132752.A28665>