Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Oct 2000 05:26:09 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        ticso@cicely5.cicely.de (Bernd Walter)
Cc:        jhb@FreeBSD.ORG (John Baldwin), jburkhol@home.com (Jake Burkholder), bp@butya.kz (Boris Popov), freebsd-smp@FreeBSD.ORG, mark@grondar.za (Mark Murray)
Subject:   Re: Problems with kthread_exit() and SMPng
Message-ID:  <200010060526.WAA22981@usr02.primenet.com>
In-Reply-To: <20001006002200.E40689@cicely5.cicely.de> from "Bernd Walter" at Oct 06, 2000 12:22:01 AM

next in thread | previous in thread | raw e-mail | index | archive | help
> The situation with such functions is not uncritical as you may need to
> release other mutexes before you call printf();

Holding multiple mutexes should only  ever occur when doing
list or other multiple pointer manipulation which needs to be
done in such a way as to appear atomic, so this is pretty
much a bogus argument.


> Say you have a driver which is called via another driver (upcall, ...).
> The other driver is not updated and calls us while holding Giant and we
> need to fetch one of our own mutexes for processing. That means we have to
> own Giant before we fetch our own mutex if we want to make use of printf()
> or we need to release our before entering Giant to do printf().
> Otherwise we don't have a fixed mutex order :(

Grab the printf mutex, queue the request, release the printf
mutex.  A mutex protexts data structure manipulations (in this
example, the events queued for console display), _not_ code.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.


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?200010060526.WAA22981>