I'm trying to understand how the below works in Linux:
What happens when you fork() from one of the created threads?
- what happens to other threads?
What happens when you fork() from the main thread (the thread/process calling fork)?
- What happens if the main thread/process has multiple threads running? Does all the threads get duplicated too?
In both the above cases, where is the SIGCHLD signal sent to when the forked child process terminates?