July 10 Flashcards
(22 cards)
Signals:
form of interprocess communication
unexpected asychronous events that can happen at an time
example of signals
floating point error death of child interval timer expired termination request suspend request
events are called what
interrupts
when a kernal recognizes an event it does
signal to the process
can normal processes send signals
yes
what are signals for
when a program forks into 2 more processes, rarely do they execute independently
the forked processes need what
sychronization
this does not transfer data
example signals
SIGINT - terminates by ctr c
SIGSTOP - suspends process
death of child
interval timer (alarm clock) expires
SIGSEGV
segmantation fault
SigPipe
writing to a pipe whose read end is closed
SigPipe
writing to a pipe whose read end is closed
what is needed for signals
include
signal handler
when c program recieves a signal, control is imeeddiantly passed to a signal handler
how a process can deal with signal
- do a user defined action
- ignore signal
- take default action (usually termination of process)
signal(SIGINT, SIG_IGN);
calls ignore signal, and does nothing if give SIGINT
signal(SIGFPE, SIGDFL)
default response
can you change all signal responses uusing what fcn?
no SIGKILL and SIGSTOP cannot change using sig(action()
can you change all signal responses uusing what fcn?
no SIGKILL and SIGSTOP cannot change using sig(action()
blocking signals
can temporarily block it
signal is held until process unblocks it
when process ignores a signal it is throw away
What happen if a signal is recieved when a handler is running
first is suspended and newly invoked handler runes then the first hanlder is resumed
sa_mask
can be used to block out signals while one handler is running
signal sets
are usetd to store sets of signals that are currently blocked and unblocked