Menu

#193 Thread suspending does not work properly on Linux 2.6 kernel

open
nobody
5
2012-11-20
2004-07-30
No

When calling ost::Thread::suspend() on a Linux system
with the 2.6 kernel (SuSE 9.1), then the whole process
is suspended instead of only a single thread. The
example included below gives the following result:

---------------------------------------------------------

> ./suspend-test

[1]+ Stopped ./suspend-test
> jobs
[1]+ Stopped ./suspend-test

---------------------------------------------------------

#include <iostream>
#include <cc++/thread.h>

class CMyThread: public ost::PosixThread
{
public:
virtual void run()
{ std::cout << "Hi !\n"; }
};

int main(int argc, char** argv)
{
CMyThread T;
T.start();
T.suspend();
T.join();
return 0;
}

Discussion


Log in to post a comment.