[586] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

pthread_cancel

daemon@ATHENA.MIT.EDU (Michael Widenius)
Fri Mar 7 12:00:16 1997

Date: Fri, 7 Mar 1997 18:39:23 +0200 (EET)
From: Michael Widenius <monty@tcx.se>
To: Craig Taverner <craig@hobbes.gh.wits.ac.za>, pthreads@MIT.EDU
In-Reply-To: <Pine.LNX.3.93.970307161449.7756H-100000@occam.gh.wits.ac.za>
Reply-To: monty@analytikerna.se

>>>>> "Craig" == Craig Taverner <craig@hobbes.gh.wits.ac.za> writes:

Craig> Hi,
Craig> I've developed a number of thread based timeout routines for common socket
Craig> operations (connect, accept, read, write, and others) under Solaris 2.5
Craig> using the solaris pthread library.  Everything works quite well.  I then
Craig> tried to run this under Linux with Proven's Pthreads and found that they
Craig> appear not to have pthread_cancel and associated functions
Craig> (pthread_setcancelstate(), etc).

Craig> I was using the pthread library Proven announced in Nov 96.  From the web
Craig> page this appears to be the latest.  Does it really not have
Craig> pthread_cancel().  Is pthread_cancel not part of the posix standard?  I've
Craig> just tried the kernel based (clone() based) LinuxThreads version of
Craig> pthreads from Xavier Leroy.  My code seems to work fine with them.

Craig> Are the Xavier threads more advanced than the Proven ones, or is it just
Craig> that Proven had to compromise on functionality in order to support such a
Craig> wide range of operating systems?  Is it the user-level threading issue
Craig> that prevents the easy implementation of pthread_cancel?

Under linux you should use LinuxThreads. These use the clone() call with
gives them a big (at least 10%) performance overhead and they scale to
multiple processors. I have used them with mysql and they works very well.
The new gnu libc also uses Linuxthreads.
The MIT thread package is great for other operating systems that
doesn't have native thread packages.
Proven threads doesn't implement all Posix thread library calls and some functions
have different parameters than Posix. Avoid them until somebody
upgrades them to be Posix!

Yours, Monty

home help back first fref pref prev next nref lref last post