From owner-freebsd-hackers Wed Dec 2 10:24:22 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA19914 for freebsd-hackers-outgoing; Wed, 2 Dec 1998 10:24:22 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA19909 for ; Wed, 2 Dec 1998 10:24:20 -0800 (PST) (envelope-from eischen@vigrid.com) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id NAA11967; Wed, 2 Dec 1998 13:23:54 -0500 (EST) Date: Wed, 2 Dec 1998 13:23:54 -0500 (EST) From: Daniel Eischen Message-Id: <199812021823.NAA11967@pcnet1.pcnet.com> To: eischen@vigrid.com, jb@cimlogic.com.au, lists@tar.com, scrappy@hub.org Subject: Re: pthread_cancel() function... Cc: freebsd-hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > It strikes me that the "pain in the you know what" part of this > is the syscall wrapping -- though its more than syscalls involved. > There are also some libc library functions that are manditory > cancellation points too. > > If you wrap a syscall to make it a cancellation point, then each > function in libc that calls the wrapped syscall becomes a cancellation > point too. Do we really care about that? Isn't a single cancellation check _before_ the system call is made good enough? > The problem with this is that while some of those > functions are optional or manditory cancellation points, others > are not. The spec also says that function calls that are not > manditory or optional cancellation points should never be cancellation > points (so the user can know when he is subject to cancellation). If a function in libc calls another function/system call that is a cancellation point, it doesn't seem right that it really be a cancellation point. The user may not, or probably doesn't know, how a library function is implemented so it isn't apparent to him that the library function he is calling is a cancellation point. I'd recommend that we only wrap the library functions and system calls as defined in the POSIX spec, and provide one cancellation check before the real call is made. This obviously makes things easier, but I don't know if it is correct. From what I've seen in the POSIX spec, it doesn't mention cancellability of system calls when called from non-cancellable library routines. > I've implemented the wrapped syscalls as described above for my > port of linux threads (ie. as in point 3 above), and for my > playing around with kernel threads. (I also have an implementation > of the pthreads cancellation code that I've used with the kernel > threads stuff). But, I haven't tried looking at libc as a whole > (ie. points 2 and 4). I'd happily send you the code I've implemented, > and you're free to use it in the cancellation stuff you're working on. Well, if we have to do what you suggest, I'll ask you for it when I get back to cancellation - thanks. Dan Eischen eischen@vigrid.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message