On a linux system, does the child process view the existing threads the same way as the parent process ?
int main() {
//create thread 1
int child_pid = fork();
if ( 0 == child_pid)
{
..
}
else
{
..
}
Since the whole address space is copied for the child process, what happens to the state of the threads. What if the thread 1 in the above segment is waiting on a conditional signal. Is it in the waiting state in child process as well ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…