TRT
Sign in

Advanced · Module 6 · Lesson 4 of 10

Signal Masks, Pending Signals, and Async-Signal Safety

Block and unblock signals using sigset_t bitmasks, trace signal coalescence in pending bitmaps, eliminate pause race conditions with sigsuspend, and guarantee async-signal safety.

Pro — members onlyAbout 16 minutes

By the end you can

  • Manipulate signal sets using sigemptyset, sigfillset, sigaddset, and sigdelset
  • Protect critical sections against interruption using sigprocmask
  • Differentiate non-queued standard POSIX signals from real-time queued signals
  • Identify async-signal-safe library functions and eliminate allocator deadlocks

Builds on Signal Architecture and Delivery with sigaction.

01 · A question first

Why does calling printf() or malloc() inside a signal handler work during quick testing, yet intermittently deadlocks your production server under high load? The answer lies in reentrancy, global heap locks, and POSIX async-signal safety.

Make a guess before you read on.

02 · The idea

Members only

Unlock the full lesson

This lesson is part of the membership. Join to read it in full, along with every other premium deep dive.

What's inside

  • Start with the problem
  • How the idea works
  • Why it is correct
  • What it costs
  • Pitfalls and variations
  • Where it is used

03 · Practice

Something wrong with this lesson? Report a problem