[fpc-devel]promised tthread patch

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Sat Nov 15 12:27:28 CET 2003


On Fri, 14 Nov 2003, Johannes Berg wrote:

> On Fri, 2003-11-14 at 21:34, KJK::Hyperion wrote:
> > I don't agree with the notes about Suspend/Resume. Suspending a thread on
> > POSIX is possible, as long as you define what "suspending" means. Assuming
> > a "suspended" thread is a thread that doesn't execute application code,
> > forcing the target thread to wait on a mutex would be enough, IMHO (on a
> > side note, this is how some third party extensions for Windows implement
> > SIGSTOP semantics). Don't be too quick about dismissing "suspending" as
> > "non-portable": condition variables and thread canceling were thought as
> > *impossible* to implement on Win32, before RedHat successfully implemented
> > the POSIX threads interface on Win32
> 
> Ok, let me rephrase.
> Suspending at any arbitrary point as the semantics of .suspend() are, is
> afaik impossible (and besides -- not a good idea either).
> 
> I do plan on adding an implementation for the thread calling .suspend on
> itself though (could be implemented via the same pipe I already have in
> there again).

I don't understand what the problem is with implementing suspend? 
Linux and Unix in general have the STOP signal for this since ages.

All you need to do is send the STOP signal to the thread. pthreads provides
functionality for this.

Michael.




More information about the fpc-devel mailing list