Inter Process Communciation (IPC)
Process Persistence
- Exists as long as it is held open by a process
- Pipes and FIFOs
- TCP, UDP sockets
- Mutex , condition variables , read write locks
- POSIX memroy based semaphores
Kernel Persistence
- Exists until kernel reboots or IPC objects is explicitly deleted
- Message Queues , semaphores & shared memory are at least kernel persistent
File system Persistence
- Exists until IPC objects is explicitly deleted , or file system crashes
- Message queues, semaphores & shared memory can be file system persistent if implemented using mapped files
Signals
signals are usually used by OS to notify process that some event has occurred , without these processes needing to poll for the event.
whenever a process receives a signal , it is interrupted from whatever it is doing and forced to execute a piece of code called signal hander. when signal handler function returns, the process continues execution as if this interruption has never occurred.
signal handler is a function that gets called when a process receives a singal. it is called in asynchronous mode.
Synchronous signals
pertains to a specific action in the program and is delivered (unless blocked) during that action.
- most errors generate singals synchronously
- Explicit request by a process to generate a signal for the same process
Asynchronous signals
gnerated by the event outside the control of the process that receives them. Theses signals arrive at unpredictable times during execution.
- External events generate requests asynchronously
- Explict request by a process to generate a signal for some other process
we can make signal handler with trap built in command.
'Operating System > System Programming(Arif Butt)' 카테고리의 다른 글
Lec26,27) Programming UNIX Pipes and Named Pipes (0) | 2021.07.20 |
---|---|
Lec25) Design and Code Of Signal Handlers (0) | 2021.07.17 |
Lec23 Multi Threaded Programming (0) | 2021.07.15 |
Lec21 Process Scheduling Algorithms (0) | 2021.07.13 |
Lec20) Design and Code Of Daemon Processes (0) | 2021.07.12 |