From owner-freebsd-hackers Tue Dec 1 20:57:43 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA06810 for freebsd-hackers-outgoing; Tue, 1 Dec 1998 20:57:43 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from thelab.hub.org (nat1001.mpoweredpc.net [142.177.191.239]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA06803 for ; Tue, 1 Dec 1998 20:57:40 -0800 (PST) (envelope-from scrappy@hub.org) Received: from localhost (scrappy@localhost) by thelab.hub.org (8.9.1/8.9.1) with ESMTP id AAA02917; Wed, 2 Dec 1998 00:57:14 -0400 (AST) (envelope-from scrappy@hub.org) X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs Date: Wed, 2 Dec 1998 00:57:14 -0400 (AST) From: The Hermit Hacker To: John Birrell cc: freebsd-hackers@FreeBSD.ORG Subject: Re: pthread_cancel() function... In-Reply-To: <199812020205.NAA07037@cimlogic.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 2 Dec 1998, John Birrell wrote: > 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? Very sure, but the developer has been *very* receptive to fixes and patches that I've sent him...what would you suggest? Just replace with pthread_detach() if pthread_cancel() doesn't exist? Or something altogether different? Marc G. Fournier Systems Administrator @ hub.org primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message