title: In Linux/C++, does a signal sent to a thread/process make it become active?
body: <p>In Linux, when a signal is sent to a process/thread (for whatever reason), is the signal handler (assuming there is one, and the signal isn't blocked) called immediately? </p>
  
  <p>I mean, I'm pretty sure that in the process/thread that handles the signal it will be called immediately, but I mean with respect to other processes/threads. </p>
  
  <p>And if the handler is called immediately, will it also make the corresponding process/thread active (so that its normal execution continues immediatly)?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>As my original question seems to have been misunderstood, I'll try to explain again with an example.</p>
  
  <p>Lets say in my computer I have a single CPU, and 2 processes running, process 'A' and process 'B'. And assume none of them is blocking in a system call (like <code>sleep</code>). Normally, I guess, the OS will switch between executing process 'A' and process 'B', after small periods of time (e.g. execute process 'A' for 100ms, then process 'B' for 100ms, then process A again for 100ms, etc.). Let's say process 'A' is now the active process (i.e. it's the one now occupying the CPU). Say now that process 'A' sends a signal to process 'B' (or, alternately, the OS sends this signal to process 'B', for whatever reason). Process 'B' has registered an handler for that signal, and is not blocking it. So the question is, will the OS now immediately stop executing process 'A' and switch to executing the signal handler of process 'B'? And if the answer is yes, will it afterwards immediately continue executing process 'B' (The normal code, not the signal handler), or switch back to executing process 'A', and only after some small period of time resume with executing process 'B'?</p>
  
  <p>And then the same questions can be asked about threads rather than processes.</p>