Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Dec 1998 13:23:54 -0500 (EST)
From:      Daniel Eischen <eischen@vigrid.com>
To:        eischen@vigrid.com, jb@cimlogic.com.au, lists@tar.com, scrappy@hub.org
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: pthread_cancel() function...
Message-ID:  <199812021823.NAA11967@pcnet1.pcnet.com>

next in thread | raw e-mail | index | archive | help
> 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



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