ctrl- to exit : : generally speakingsignals must be used with cautions not made obvious by the examples we've just seen for instancesome system calls don' react well to being interrupted by signalsand only the main thread can install signal handlers and respond to signals in multithreaded program when used wellthoughsignals provide an event-based communication mechanism they are less powerful than data streams such as pipesbut are sufficient in situations in which you just need to tell program that something important has occurred and don' need to pass along any details about the event itself signals are sometimes also combined with other ipc tools for examplean initial signal may inform program that client wishes to communicate over named pipe--the equivalent of tapping someone' shoulder to get their attention before speaking most platforms reserve one or more sigusr signal numbers for user-defined events of this sort such an integration structure is sometimes an alternative to running blocking input call in spawned thread see also the os kill(pidsigcall for sending signals to known processes from within python script on unix-like platformsmuch like the kill shell command used earlierthe required process id can be obtained from the os fork call' child process id return value or from other interfaces like os forkthis call is also available in cygwin pythonbut not in standard windows python also watch for the discussion about using signal handlers to clean up "zombieprocesses in the multiprocessing module now that you know about ipc alternatives and have had chance to explore processesthreadsand both process nonportability and thread gil limitationsit turns out that there is another alternativewhich aims to provide just the best of both worlds as mentioned earlierpython' standard library multiprocessing module package allows scripts to spawn processes using an api very similar to the threading module this relatively new package works on both unix and windowsunlike low-level process forks it supports process spawning model which is largely platform-neutraland provides tools for related goalssuch as ipcincluding lockspipesand queues in additionbecause it uses processes instead of threads to run code in parallelit effectively works around the limitations of the thread gil hencemultiprocessing allows the programmer to leverage the capacity of multiple processors for parallel taskswhile retaining much of the simplicity and portability of the threading model why multiprocessingso why learn yet another parallel processing paradigm and toolkitwhen we already have the threadsprocessesand ipc tools like socketspipesand thread queues that the multiprocessing module