Results 1 to 3 of 3
hi all, any one know what is the difference between signals & interrupts? please let me know......
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-07-2012 #1
- Join Date
- Feb 2012
difference between sinals & interrupts
any one know what is the difference between signals & interrupts?
please let me know...
- 09-07-2012 #2
Signals are part of Linux. They can be sent by the kernel to a process or between processes. There are also signals that you can send from your keyboard. Interrupts belong to hardware.A device raises an interrupt when it wants the kernel to attend to it.
Confusingly one of the signals that you can send to a currently running program is called the interrupt signal (SIGINT). You send it by pressing ctrl-C."I'm just a little old lady; don't try to dazzle me with jargon!"
- 09-07-2012 #3
- Join Date
- Apr 2009
- I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
Actually, Hazel is about 3/4 correct. There are software as well as hardware interrupts. They are both handled in the kernel, which has an IDT (interrupt descriptor table), a set of function vectors that are called when the interrupt occurs. Signals are triggers for software interrupts that get passed back to the user-space code that interrupts (unless masked out) the user-space program. For example, I set up a function in my programs that is called when a SIGINT signal occurs so that it can clean up resources before it exits. The default behavior is to simply kill the program. Another example of a signal handler is in the system 'dd' (disk dump) utility. They can run a long time when writing an entire disc image, so it is written so that the SIGUSR1 signal will cause it to dump to the terminal a progress report. The system 'kill' command is typically used to signal a task. Anyway, here is a nice set of slides in a PDF that covers the subject matter very well: http://cs-pub.bu.edu/fac/richwest/cs...es/wk3_pt2.PDFSometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!