Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Operating system
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=====Signal===== To generate ''software interrupts'' in [[Unix-like]] operating systems, the <code>kill(pid,signum)</code> [[system call]] will send a [[Signal (IPC)|signal]] to another process.<ref name="duos-p200">{{cite book | last = Bach | first = Maurice J. | title = The Design of the UNIX Operating System | publisher = Prentice-Hall | year = 1986 | page = 200 | isbn = 0-13-201799-7 }}</ref> <code>pid</code> is the [[process identifier]] of the receiving process. <code>signum</code> is the signal number (in [[mnemonic]] format){{efn|Examples include [[Signal (IPC)#SIGINT|SIGINT]], [[SIGSEGV]], and [[SIGBUS]].}} to be sent. (The abrasive name of <code>kill</code> was chosen because early implementations only terminated the process.)<ref name="lpi-ch20-p400">{{cite book | last = Kerrisk | first = Michael | title = The Linux Programming Interface | publisher = No Starch Press | year = 2010 | page = 400 | isbn = 978-1-59327-220-3 }}</ref> In Unix-like operating systems, ''signals'' inform processes of the occurrence of asynchronous events.<ref name="duos-p200"/> To communicate asynchronously, interrupts are required.<ref name="sco-ch5-p308_b">{{cite book | last = Tanenbaum | first = Andrew S. | title = Structured Computer Organization, Third Edition | publisher = Prentice Hall | year = 1990 | page = [https://archive.org/details/structuredcomput00tane/page/308 308] | isbn = 978-0-13-854662-5 | url = https://archive.org/details/structuredcomput00tane/page/308 }}</ref> One reason a process needs to asynchronously communicate to another process solves a variation of the classic [[Readers–writers problem|reader/writer problem]].<ref name="osc-p182">{{cite book | last = Silberschatz | first = Abraham | title = Operating System Concepts, Fourth Edition | publisher = Addison-Wesley | year = 1994 | page = 182 | isbn = 978-0-201-50480-4 }}</ref> The writer receives a pipe from the [[Shell (computing)|shell]] for its output to be sent to the reader's input stream.<ref name="usp-ch6-p153">{{cite book | last1 = Haviland | first1 = Keith | last2 = Salama | first2 = Ben | title = UNIX System Programming | publisher = Addison-Wesley Publishing Company | year = 1987 | page = 153 | isbn = 0-201-12919-1 }}</ref> The [[Command-line interface|command-line]] syntax is <code>alpha | bravo</code>. <code>alpha</code> will write to the pipe when its computation is ready and then sleep in the wait queue.<ref name="usp-ch6-p148">{{cite book | last1 = Haviland | first1 = Keith | last2 = Salama | first2 = Ben | title = UNIX System Programming | publisher = Addison-Wesley Publishing Company | year = 1987 | page = 148 | isbn = 0-201-12919-1 }}</ref> <code>bravo</code> will then be moved to the [[Multilevel feedback queue|ready queue]] and soon will read from its input stream.<ref name="usp-ch6-p149">{{cite book | last1 = Haviland | first1 = Keith | last2 = Salama | first2 = Ben | title = UNIX System Programming | publisher = Addison-Wesley Publishing Company | year = 1987 | page = 149 | isbn = 0-201-12919-1 }}</ref> The kernel will generate ''software interrupts'' to coordinate the piping.<ref name="usp-ch6-p149"/> ''Signals'' may be classified into 7 categories.<ref name="duos-p200"/> The categories are: # when a process finishes normally. # when a process has an error exception. # when a process runs out of a system resource. # when a process executes an illegal instruction. # when a process sets an alarm event. # when a process is aborted from the keyboard. # when a process has a tracing alert for debugging.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)