POSIX Threads: Create, Join & Detach

25 min subscribersLinux 6.12C11glibc 2.39→ module 5 lab
What you'll learn
  • Distinguish NPTL 1:1 clone() sharing flags, process TGID (getpid()) vs kernel TID (gettid()), and opaque pthread_self().
  • Spawn worker threads with -pthread and pthread_create() using dedicated per-worker struct slots and direct return-code checks.
  • Harvest worker results via pthread_join() or enable automatic reclamation via pthread_detach() without stack-pointer hazards.

Subscribe or sign in to unlock this lesson

Distinguish NPTL 1:1 clone() sharing flags, process TGID ( getpid() ) vs kernel TID ( gettid() ), and opaque pthread_self() . Spawn worker threads with -pthread and pthread_create() using dedicated per-worker struct slots and direct return-code checks. Harvest worker results via pthread_join() or enable automatic reclamation via pthread_detach() without stack-pointer hazards.

Part of GL-C02 — Filesystems, Signals, Processes & Threads. Full access includes all 16 KSA Terminal courses across GL-C01..GL-C04, GL-E00..GL-E07 & GL-Q01..GL-Q04 (288 lessons, 96 TAP 13 graded labs, real Linux 6.12, C11 & C++20/Qt 6 captures, slide decks, printable PDF/HTML handbooks, and flashcards).

Annual All-AccessUS$349/yrsave 25% · 3 months free
Monthly All-AccessUS$39/moCancel any time · All 16 courses
Team (3+ seats)US$290/seat/yrCard or Net-30 PO invoice
Course syllabus
Progress is saved on this device.

search — fzf

0/0 ───────────────────────────────────────────

keyboard shortcuts — less

/
search
f
focus mode
[
previous
]
next
?
help
Esc
close

figure