0% found this document useful (0 votes)
19 views

CS 241 Discussion Section

The document summarizes the contents of a CS 241 discussion section on signals and HTTP headers. The section reviewed how processes can send and handle signals, including blocking and custom signal handlers. It also provided an example function for setting signal handlers. The latter part of the section discussed HTTP headers as the message components of requests and responses in the Hypertext Transfer Protocol.

Uploaded by

jaime_parada3097
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

CS 241 Discussion Section

The document summarizes the contents of a CS 241 discussion section on signals and HTTP headers. The section reviewed how processes can send and handle signals, including blocking and custom signal handlers. It also provided an example function for setting signal handlers. The latter part of the section discussed HTTP headers as the message components of requests and responses in the Hypertext Transfer Protocol.

Uploaded by

jaime_parada3097
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 11

CS 241 Discussion Section

(26/04/12)
Contents
Signals
MP8 - HTTP Headers
Review: signals
Asynchronous notification to a process indicating
some action should be taken

Sending signals to a process:
kill -<signal> <pid>
int kill(pid_t pid, int sig);

We can signal individual threads, too:
int pthread_kill(thread_t tid, int sig);
What can we do with signals?
Handle them!
Default or Ignore
Custom function with sigaction

Block them!
Delay delivery with masks
Then we can sigwait to get them.
One function to rule them all
void ( *signal(int signum, void (*handler)(int)) )
(int);

But what does it all mean?
One function to rule them all
void ( *signal(int signum, void (*handler)(int)) )
(int);

But what does it all mean?
Symbol
One function to rule them all
void ( *signal(int signum, void (*handler)(int)) )
(int);

But what does it all mean?
Symbol
Function Args
One function to rule them all
void ( *signal(int signum, void (*handler)(int)) )
(int);

But what does it all mean?
Symbol
Function Args
Return Type
One function to rule them all
void ( *signal(int signum, void (*handler)(int)) )
(int);

But what does it all mean?
typedef void (*sighandler_t)(int);

sighandler_t signal(int signum, sighandler_t
handler);

HTTP Header
Components of the message header of
requests and responses in the Hypertext
Transfer Protocol (HTTP)
12/02/09
Code Examples
ds12/signals.c

You might also like