[fpc-devel]promised tthread patch

Pedro Lopez-Cabanillas plcl at telefonica.net
Sun Nov 16 03:08:50 CET 2003


Michael.VanCanneyt at Wisa.be wrote:
> On Sat, 15 Nov 2003, KJK::Hyperion wrote:
> > At 12.27 15/11/2003, you wrote:
> > >All you need to do is send the STOP signal to the thread.
> >
> > This is a common misunderstanding. I quote from IEEE 1003.1:
> >
> > "[...]
> >
> > Note that pthread_kill() only causes the signal to be handled in the
> > context of the given thread; the signal action (termination or stopping)
> > affects the process as a whole.
> >
> > [...]"
>
> Strange. How do you explain that Kylix uses it ? I've used threads in
> Kylix, and they definitely work with suspend... Probably because for linux,
> each thread is a different process anyway ? (at least till the 2.4 kernels)

Red Hat has already backported the new NPT to 2.4, and it is included in RH9  
IIRC. You can expect that Kylix multithreaded programs won't work very well 
under RH9 and newer Linux distributions, if they use TThread.Suspend and 
TThread.Resume (implemented using the signals SIGSTOP and SIGCONT). Borland 
shows little interest on Kylix updates, giving to the competitors a  good 
chance to increase market share ;-)

It is on-topic a little citation of the announcement of Native POSIX Thread 
Library. The complete article can be found here:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&safe=off&selm=3D8A6EC1.1010809%40redhat.com&rnum=1

From: Ulrich Drepper (drepper at redhat.com)
Subject: [ANNOUNCE] Native POSIX Thread Library 0.1 
Date: 2002-09-19 17:50:06 PST 

[...]
The thread library is designed to be binary compatible with the old
LinuxThreads implementation.  This compatibility obviously has some
limitations.  In places where the LinuxThreads implementation diverged
from the POSIX standard incompatibilities exist.  Users of the old
library have been warned from day one that this day will come and code
which added work-arounds for the POSIX non-compliance better be
prepared to remove that code.  The visible changes of the library
include:

- - The signal handling changes from per-thread signal handling to the
   POSIX process signal handling.  This change will require changes in
   programs which exploit the non-conformance of the old implementation.

   One consequence of this is that SIGSTOP works on the process.  Job 
control
   in the shell and stopping the whole process in a debugger work now.

- - getpid() now returns the same value in all threads
[...]

Regards,
Pedro

-- 
ALSA Library Bindings for Pascal
http://alsapas.alturl.com





More information about the fpc-devel mailing list