I have done the following:
- Create a virtual timer that triggers repeatedly.
- Install signal handler for SIGVTALRM
- Call clone syscall
- Set sched_affinity such that the cloned thread runs on a different CPU
Will the cloned thread also be listening for SIGVTALRM? So will both the threads call the signal handler when SIGVTALRM is triggered? Also, after creating the new thread, can I change its signalhandler for SIGVTALRM to another function without affecting the main threads signalhandler?
I'm guessing it depends on the flags passed to clone(). Mainly, I'm using CLONE_SIGHAND and SIGCHLD. Does it depend on other flags as well?