Whenever I call thread.suspend(), my entire process seems to stop. Even if I'm using the thread1 test application, once this line of code is reached, the entire process gets suspended. I'm running this on a linux machine.
Is there any way to suspend a single thread while letting the others in that process continue?
Thanks for your help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thread suspension has been the most difficult feature to portability impliment in all of Common C++. While Win32 lacks "soft" cancellable threads found in posix pthreads, this can be largely simulated without too much difficulty. However, going the other way, posix pthread says nothing about suspending/resuming threads, a base w32 threading feature, and this has been one that has been very hard to simulate.
On some platforms, a non-standard pthread_suspend function exists which allows one to resume. On some platforms we try to do it by using signal handling, but this depends on the implimentation of signals under pthreads. Under the linux kernel, this used to work because each thread was a seperate process, and hence, the process suspend signal, when raised by a thread, would only suspend that thread. This is of course no longer true, nor has a decent substitute method to emulate this behavior been found by me yet.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Whenever I call thread.suspend(), my entire process seems to stop. Even if I'm using the thread1 test application, once this line of code is reached, the entire process gets suspended. I'm running this on a linux machine.
Is there any way to suspend a single thread while letting the others in that process continue?
Thanks for your help.
This problem only seems to happen with a 2.6 kernel. If I use a 2.4 kernel, all seems to work fine.
Has anybody been able to run the test applications on a 2.6 kernel?
Thanks.
Thread suspension has been the most difficult feature to portability impliment in all of Common C++. While Win32 lacks "soft" cancellable threads found in posix pthreads, this can be largely simulated without too much difficulty. However, going the other way, posix pthread says nothing about suspending/resuming threads, a base w32 threading feature, and this has been one that has been very hard to simulate.
On some platforms, a non-standard pthread_suspend function exists which allows one to resume. On some platforms we try to do it by using signal handling, but this depends on the implimentation of signals under pthreads. Under the linux kernel, this used to work because each thread was a seperate process, and hence, the process suspend signal, when raised by a thread, would only suspend that thread. This is of course no longer true, nor has a decent substitute method to emulate this behavior been found by me yet.