ABSTRACT

The POSIX Application Programming Interface (API) for task management and timekeeping is more complex than its RTEMS Classic counterpart presented in Chapter 5. For this reason, its description has been divided into several parts:

The chapter starts by discussing attribute objects, the main mechanism used by POSIX to configure and customize the behavior of threads and other entities it manages.

Then, we present the main thread creation and termination functions, which are used in virtually all POSIX concurrent multithreaded programs and we look at the POSIX scheduling model and its policies, which define how threads are executed. The discussion of the functions typical of multicore scheduling is deferred to Chapter 13.

Another important topic addressed in this chapter is how POSIX supports thread cancellation, that is, the forced termination of a thread upon request from another thread.

Signals are the way POSIX supports the software equivalent of an interrupt directed to a thread. This is the main mechanism used to notify threads of external asynchronous events, like timer expiration and message arrival.

A discussion of the main POSIX timekeeping functions, realized by means of clocks and timers, concludes the chapter.