liveBook · Manning

Sig_atomic_t

sig_atomic_t is an integer type whose object evaluations and assignments are guaranteed to be indivisible with respect to signal handling.

How 2 Manning books explain it

Modern C, Third Edition

sig_atomic_t is an integer type whose object evaluation and assignment operations are guaranteed to be indivisible with respect to signal handling.

How it is used
Uses a flag to transfer a signal condition from a minimal handler to the interrupted program.
How deep it goes
Explains indivisible loads and stores, the limits of increment operations, and potential width and overflow problems.
Examples
Uses a signal-number flag and contrasts it with a signal-handler counter using lock-free atomic operations.
What you can do after
Apply it as a signal flag while avoiding unsupported counter operations.

Read how Modern C, Third Edition explains sig_atomic_t →

Modern C

sig_atomic_t is an integer C type whose object evaluations and assignments are guaranteed to be uninterruptible with respect to signal handling.

How it is used
Uses sig_atomic_t to store a signal number during signal handling.
How deep it goes
Explains uninterruptible loads and stores and why increments lack the same guarantee.
Examples
Shows a handler assigning a signal number to interrupt and contrasts assignment with incrementing a counter.
What you can do after
Evaluate whether signal-handler operations fit the type's restricted guarantees.

Read how Modern C explains sig_atomic_t →

Related concepts

Questions about sig_atomic_t

What is sig_atomic_t?

sig_atomic_t is an integer type whose object evaluations and assignments are guaranteed to be indivisible with respect to signal handling.

Which Manning books explain sig_atomic_t?

Modern C, Third Edition and Modern C.

What is the difference between sig_atomic_t and atomic type?

sig_atomic_t is an integer type whose object evaluations and assignments are guaranteed to be indivisible with respect to signal handling. An atomic type is a type whose supported accesses and operations are indivisible with respect to concurrent execution and provide defined synchronization semantics.

What kinds of sig_atomic_t are there?

Kinds of sig_atomic_t include volatile sig_atomic_t.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.