O'Reilly logo

Real-Time Embedded Systems by Xiaocong Fan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 18

Resource Sharing

Abstract

Tasks can share resources in various ways. Multiple threads within the same process can share global variables, through which data can flow back and forth among them. File or memory region objects can be shared via memory mapping by multiple processes. The integrity of an exclusive resource can be endangered when multiple tasks gain access to it at the same time. Semaphore, mutex, and condition variable are POSIX objects that are normally used to protect the integrity of shared resources. For each type of these POSIX objects, we explain the corresponding POSIX functions, examine their usage patterns, and give a few running examples.

Keyword

Shared variables

Shared memory object

Semaphore

Mutex

Condition ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required