Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Oct 2000 21:42:28 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        bright@wintelcom.net (Alfred Perlstein)
Cc:        mark@grondar.za (Mark Murray), jburkhol@home.com (Jake Burkholder), bp@butya.kz (Boris Popov), freebsd-smp@FreeBSD.ORG
Subject:   Re: Problems with kthread_exit() and SMPng
Message-ID:  <200010052142.OAA15421@usr05.primenet.com>
In-Reply-To: <20001005113139.C27736@fw.wintelcom.net> from "Alfred Perlstein" at Oct 05, 2000 11:31:39 AM

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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.

This is not something that a programmer should have to worry
about when they use a service; unless you are doing threads
IPC, perhaps in some vainglorious attempt to make SMP systems
stall their little butts off with interprocessor synchrnization,
this should never be an issue.

In other words, I don't give a damn, as a programmer, whether
a service is reentrant or not, so long as it works when I call
it.  Having the lock fairy sprinkle lock primitives before and
after every service call is not my idea of a Good Thing.


This appears to be a very good point to note that having an
owner or recursing on this lock would both end up being Very
Bad Things, since it would make the obvious and intuitive
(and therefore least astonishing) behaviour impossible.


					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?200010052142.OAA15421>