Skip to Main Content
Understanding the Linux Kernel
book

Understanding the Linux Kernel

by Daniel P. Bovet, Marco Cesati
October 2000
Intermediate to advanced content levelIntermediate to advanced
704 pages
18h 13m
English
O'Reilly Media, Inc.
Content preview from Understanding the Linux Kernel

Chapter 18. Process Communication

This chapter explains how User Mode processes can synchronize themselves and exchange data. We have already covered a lot of synchronization topics in Chapter 11, but the actors there were kernel control paths, not User Mode programs. We are now ready, after having discussed I/O management and filesystems at length, to extend the discussion of synchronization to User Mode processes. These processes must rely on the kernel to synchronize themselves and to exchange data.

As we saw in Section 12.6.1 in Chapter 12, a crude form of synchronization among User Mode processes can be achieved by creating a (possibly empty) file and by making use of suitable VFS system calls to lock and unlock it. Similarly, data sharing among processes can be obtained by storing data in temporary files protected by locks. This approach is costly since it requires accesses to the disk filesystem. For that reason, all Unix kernels include a set of system calls that supports process communication without interacting with the filesystem; furthermore, several wrapper functions have been developed and inserted in suitable libraries to expedite how processes issue their synchronization requests to the kernel.

As usual, application programmers have a variety of needs that call for different communication mechanisms. Here are the basic mechanisms that Unix systems, and Linux in particular, offer to allow interprocess communication:

Pipes and FIFOs (named pipes)

Best suited to implement ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman
Linux Kernel Debugging

Linux Kernel Debugging

Kaiwan N. Billimoria
Understanding the Linux Kernel, 3rd Edition

Understanding the Linux Kernel, 3rd Edition

Daniel P. Bovet, Marco Cesati

Publisher Resources

ISBN: 0596000022Catalog PageErrata