pthread sleep linux pthread sleep linux multithreading multithreading

pthread sleep linux


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

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


Try this,

#include <unistd.h>usleep(microseconds);


I usually use nanosleep and it works fine.Nanosleep supends the execution of the calling thread. I have had the same doubt because in some man pages sleep refers to the entire process.