Alex Rivera | Logout

pthread sleep linux

Asked 2010-09-03T04:44:34.143
30

I am creating a program with multiple threads using pthreads.

Is sleep() causing the process (all the threads) to stop executing or just the thread where I am calling sleep?

Edit
Report

1 Answer

51

Just the thread. The POSIX documentation for sleep() says:

The sleep() function shall cause the calling thread to be suspended from execution...

answered 2010-09-03T04:47:14.777

Your Answer