Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Dec 1998 13:05:08 +1100 (EST)
From:      John Birrell  <jb@cimlogic.com.au>
To:        scrappy@hub.org (The Hermit Hacker)
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: pthread_cancel() function...
Message-ID:  <199812020205.NAA07037@cimlogic.com.au>
In-Reply-To: <Pine.BSF.4.05.9812011933460.25036-100000@thelab.hub.org> from The Hermit Hacker at "Dec 1, 98 07:37:41 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
The Hermit Hacker wrote:
> The closest I can find is pthread_detach(), but according to the man page for pthread_cancel under Solaris, tehy aren't quite the same...
> 
> Anyone with experience with this that can comment?

pthread_cancel() requires tests at each of the cancellation points in
the functions that the standard nominates.

Every time I implement something like this, I suffer from the mail sent
to me by developers who say "there's no bugs in my code and it works on
such-n-such, so your code is broken". The use of pthread_cancel() in an
application often causes resource locking problems (or rather, problems
with resources not being unlocked before the thread is killed). It is
an optional part of the standard, which sort-of implies that applications
shouldn't _require_ it. Are you sure it's not optional in your application?

-- 
John Birrell - jb@cimlogic.com.au; jb@freebsd.org http://www.cimlogic.com.au/
CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



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