Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Dec 1998 07:43:36 +1100 (EST)
From:      John Birrell  <jb@cimlogic.com.au>
To:        lists@tar.com
Cc:        eischen@vigrid.com, freebsd-hackers@FreeBSD.ORG
Subject:   Re: pthread_cancel() function...
Message-ID:  <199812022043.HAA10087@cimlogic.com.au>
In-Reply-To: <199812022023.OAA00562@ns.tar.com> from "Richard Seaman, Jr." at "Dec 2, 98 02:23:43 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Richard Seaman, Jr. wrote:
> In the case of libc_r, you probably don't want to alias it
> to _thread_sys_xxx, since you probably want the wrappers for
> the blocking syscalls to be used in libc_r.  If you rename
> the uthread syscall wrappers from xxx to _xxx (eg. _read)
> and then implement xxx as a wrapper of _xxx that implements
> cancellation points, you'd be consistent.

Why do you need a second wrapper? The fact that a syscall has been
wrappered for libc_r is sufficient to include any cancellation checks
in the _existing_ wrapper code.

I don't think it is sufficient to just add what you call "wrappers".
AFAIK, the thread cancellation is supposed to occur at any time while
the thread is in one of the specified functions, not just at the beginning
or at the end. This means that code is required to check the thread
state and do things conditionally on that.

The standard says that certain functions /may/ have cancellation points,
but the "implementation shall not introduce cancellation points into
any other POSIX.1 or C standard functions". Ensuring that this is the
case is the PITA. And writing test code that exercises all the possible
combinations is impossible IMHO.

-- 
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?199812022043.HAA10087>