From owner-freebsd-hackers Tue Dec 1 17:57:40 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA20437 for freebsd-hackers-outgoing; Tue, 1 Dec 1998 17:57:40 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from cimlogic.com.au (cimlog.lnk.telstra.net [139.130.51.31]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA20432 for ; Tue, 1 Dec 1998 17:57:36 -0800 (PST) (envelope-from jb@cimlogic.com.au) Received: (from jb@localhost) by cimlogic.com.au (8.9.1/8.9.1) id NAA07037; Wed, 2 Dec 1998 13:05:09 +1100 (EST) (envelope-from jb) From: John Birrell Message-Id: <199812020205.NAA07037@cimlogic.com.au> Subject: Re: pthread_cancel() function... In-Reply-To: from The Hermit Hacker at "Dec 1, 98 07:37:41 pm" To: scrappy@hub.org (The Hermit Hacker) Date: Wed, 2 Dec 1998 13:05:08 +1100 (EST) Cc: freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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