Operating System #23 Inter Process Communication, Message Passing,Pipes, Signals
Operating System #23 Inter Process Communication, Message Passing, Pipes, Signals
00:50 Virtual Memory View
• During execution, each process can only view its virtual addresses,
• It cannot
– View another processes virtual address space
– Determine the physical address mapping
03:16 Inter Process Communication
• Advantages of Inter Process Communication (IPC)
– Information sharing
– Modularity/Convenience
• 3 ways
– Shared memory
– Message Passing
– Signals
05:00 Shared Memory: • One process will create an area in RAM which
the other process can access
• Both processes can access shared memory like a regular working memory
– Reading/writing is like regular reading/writing
– Fast
• Limitation : Error prone. Needs synchronization between processes.
06:05 Shared Memory in Linux
• int shmget (key, size, flags)
– Create a shared memory segment;
– Returns ID of segment : shmid
– key : unique identifier of the shared memory segment
– size : size of the shared memory (rounded up to the PAGE_SIZE)
• int shmat(shmid, addr, flags)
– Attach shmid shared memory to address space of the calling process
– addr : pointer to the shared memory address space
• int shmdt(shmid)
– Detach shared memory
07:40 Example on Interprocess Communication
12:54 Message Passing
• Shared memory created in the kernel
• System calls such as send and receive used for communication
– Cooperating : each send must have a receive
• Advantage : Explicit sharing, less error prone
• Limitation : Slow. Each call involves marshalling / demarshalling of information
14:26 Pipes
– Always between parent and child
– Always unidirectional
– Accessed by two associated file descriptors:
• fd[0] for reading from pipe
• fd[1] for writing to the pipe
Pipes for two way communication:
• Two pipes opened pipe0 and pipe1
• Note the unnecessary pipes
• Close the unnecessary pipes
19:58 Signals
• Asynchronous unidirectional communication between processes
• Signals are a small integer
– eg. 9: kill, 11: segmentation fault
• Send a signal to a process
– kill(pid, signum)
• Process handler for a signal
– sighandler_t signal(signum, handler);
– Default if no handler defined
Видео Operating System #23 Inter Process Communication, Message Passing,Pipes, Signals канала Xoviabcs
00:50 Virtual Memory View
• During execution, each process can only view its virtual addresses,
• It cannot
– View another processes virtual address space
– Determine the physical address mapping
03:16 Inter Process Communication
• Advantages of Inter Process Communication (IPC)
– Information sharing
– Modularity/Convenience
• 3 ways
– Shared memory
– Message Passing
– Signals
05:00 Shared Memory: • One process will create an area in RAM which
the other process can access
• Both processes can access shared memory like a regular working memory
– Reading/writing is like regular reading/writing
– Fast
• Limitation : Error prone. Needs synchronization between processes.
06:05 Shared Memory in Linux
• int shmget (key, size, flags)
– Create a shared memory segment;
– Returns ID of segment : shmid
– key : unique identifier of the shared memory segment
– size : size of the shared memory (rounded up to the PAGE_SIZE)
• int shmat(shmid, addr, flags)
– Attach shmid shared memory to address space of the calling process
– addr : pointer to the shared memory address space
• int shmdt(shmid)
– Detach shared memory
07:40 Example on Interprocess Communication
12:54 Message Passing
• Shared memory created in the kernel
• System calls such as send and receive used for communication
– Cooperating : each send must have a receive
• Advantage : Explicit sharing, less error prone
• Limitation : Slow. Each call involves marshalling / demarshalling of information
14:26 Pipes
– Always between parent and child
– Always unidirectional
– Accessed by two associated file descriptors:
• fd[0] for reading from pipe
• fd[1] for writing to the pipe
Pipes for two way communication:
• Two pipes opened pipe0 and pipe1
• Note the unnecessary pipes
• Close the unnecessary pipes
19:58 Signals
• Asynchronous unidirectional communication between processes
• Signals are a small integer
– eg. 9: kill, 11: segmentation fault
• Send a signal to a process
– kill(pid, signum)
• Process handler for a signal
– sighandler_t signal(signum, handler);
– Default if no handler defined
Видео Operating System #23 Inter Process Communication, Message Passing,Pipes, Signals канала Xoviabcs
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Operating System #24 Synchronization: Race Conditions, Critical Section, Locks & UnlocksUsing Pipes and Named Pipes to get your programs working together.Programming with Pipes in LinuxOperating System #25 How to Implement Locking: Software SolutionsMessage Passing Systems (Part 1)L4 and Fast Interprocess CommunicationThe Mill CPU Architecture – Inter-Process Communication (12 of 13)Operating System #26 Bakery AlgorithmCommunicating between processes (using pipes) in CInterprocess CommunicationLinux Internals : Interprocess CommunicationOperating System #29 SemaphoresMM101 introduction to memory managementOperating System #33 Threads: Thread Model, Thread vs Process, pthread libraryFIFOs in LinuxOperating System #05 Memory Management: Process, Fragmentation, Deallocation,Shared Memory SystemsOperating Systems Lecture 4: Process Execution MechanismsSockets in Operating System