YOUR LINK HERE:


http://youtube.com/watch?v=G2vwkBZy894



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

#############################









Content Report
Youtor.org / YTube video Downloader © 2025

created by www.youtor.org