Tagged articles
pthread
23 articles · Page 1 of 1
This article dives deep into Linux pthread fundamentals, covering process‑vs‑thread concepts, the POSIX API, kernel implementation via the clone syscall, thread lifecycle, synchronization primitives, common pitfalls such as deadlocks, stack overflows and thread leaks, and provides practical debugging and mitigation techniques with real code examples.
LinuxMultithreadingclone syscall
0 likes · 55 min read

The article analyses a recurring crash in an iOS driver app caused by the __dispatch_barrier_waiter_redirect_or_wake function in libdispatch, explains the EXC_BREAKPOINT/SIGTRAP mechanism, compares libdispatch versions, reveals a premature queue release due to non‑atomic reference‑count handling, and proposes replacing GCD‑based barriers with pthread_rwlock_t to eliminate the bug.
BarrierGCDReferenceCounting
0 likes · 15 min read

This article explains the role of the Linux user stack in multithreaded programs, covering its memory layout, how each thread gets a private stack, stack frame mechanics, growth and overflow handling, and practical examples of creating and debugging stacks with pthreads and gdb.
C++LinuxStack Overflow
0 likes · 24 min read

This article explains the core principles, API usage, and best‑practice steps for pthread condition variables in embedded Linux, showing why they must be paired with mutexes, how to avoid lost wake‑ups, when to use signal versus broadcast, and includes a complete C example with practical tips.
c-programmingcondition variablepthread
0 likes · 9 min read

This guide explains Linux thread fundamentals, covering definitions, differences from processes, user‑level vs kernel‑level models, creation and termination with pthread APIs, attribute settings, cancellation, cleanup, detaching, and scheduling policies, all illustrated with complete code examples.
LinuxPOSIXScheduling
0 likes · 18 min read

This article provides a comprehensive guide to Linux threads, covering fundamental concepts, the distinction between processes and threads, user‑level vs kernel‑level threading, thread creation and termination with POSIX APIs, attribute settings, cancellation, cleanup, detachment, scheduling policies, and practical code examples.
LinuxPOSIXpthread
0 likes · 17 min read

This article explains the inner workings of Linux thread stacks, distinguishes user and kernel stacks, shows how NPTL creates independent stacks, highlights common pitfalls like stack overflow, memory leaks, and address‑space exhaustion, and provides practical C/C++ examples, tuning tips, thread‑pool designs, and debugging tools to keep your multithreaded programs stable and efficient.
LinuxStack OverflowThread Stack
0 likes · 46 min read

This article explains the purpose, actions, and common types of locks in iOS—including spin locks, mutexes, semaphores, and read‑write locks—provides practical code examples, discusses underlying principles such as busy‑waiting and priority inversion, and compares performance across different lock implementations.
LocksMultithreadingSemaphore
0 likes · 18 min read

This article introduces the POSIX standard for portable multithreaded and network programming in C, explains thread creation, lifecycle, and synchronization mechanisms such as mutexes, semaphores and condition variables, and provides complete server‑client socket examples together with practical multithreaded file‑processing code and debugging tips.
C++MultithreadingPOSIX
0 likes · 23 min read

This article explains the concept of spin locks, compares them with mutexes, shows how to use the pthread API and C++ atomic_flag to implement them, outlines suitable scenarios, highlights CPU‑usage pitfalls, and provides practical code examples.
C++ConcurrencyLinux
0 likes · 10 min read

This article provides a comprehensive overview of POSIX threads, covering their architecture, creation, synchronization, attributes, scheduling policies, advantages, drawbacks, and real‑world examples such as mutex protection, barrier synchronization, and a cross‑platform network server implementation.
LinuxMultithreadingPOSIX
0 likes · 21 min read

This guide shows how to create and manage multiple pthreads in an embedded Linux program, then monitor each thread’s runtime using the top command with the -H option, including the need to set thread names via pthread_setname_np for clear identification.
LinuxMultithreadingpthread
0 likes · 5 min read

This guide shows how to create a multi‑threaded C program on embedded Linux, set thread names with pthread_setname_np, and use the top command with the -H option to display each thread’s status, illustrating the difference when thread names are omitted.
EmbeddedLinuxdebugging
0 likes · 6 min read

This article explains the concepts of user threads, the pthread library implementation, thread creation and termination functions, synchronization mechanisms like mutexes and condition variables, and demonstrates how to design and use a lightweight C thread‑pool with practical code examples.
LinuxMultithreadingc-programming
0 likes · 21 min read

This article investigates intermittent Java Agent errors caused by Instrumentation.appendToSystemClassLoaderSearch in container environments, tracing the issue through JNI calls, glibc stat failures, locale‑dependent iconv conversion, and ultimately fixing it with pthread thread‑local storage and proxy wrappers.
IConvJNIJava
0 likes · 11 min read

This article explains the limitations of the traditional Unix fork model, introduces lightweight POSIX threads as a faster alternative, and provides a comprehensive guide to thread creation, attributes, synchronization primitives, and cleanup functions using the pthread library in Linux.
LinuxMultithreadingPOSIX
0 likes · 17 min read

Starting from mysterious Java Agent errors in Alibaba Cloud environments, this article traces the failure through the JVM’s Instrumentation.appendToSystemClassLoaderSearch call, examines glibc’s stat and iconv conversions, reveals thread‑local storage issues, and presents concrete fixes using pthread TLS and proxy wrappers.
IConvJVMJava Agent
0 likes · 12 min read

This article explores obscure Android thread issues—including uncontrolled thread creation, stack memory leaks, and the impact of thread‑priority settings—while presenting monitoring techniques, a pthread hook implementation, and performance considerations to help developers detect and resolve thread‑related crashes.
AndroidThread Leakhook
0 likes · 15 min read

This session reviews PThread fundamentals and advanced techniques in C, covering thread creation, termination, attributes, mutexes, reader‑writer locks, condition variables, semaphores, barrier synchronization, and thread‑specific data, with code examples and a concluding homework assignment.
MultithreadingMutexSemaphore
0 likes · 11 min read

This article walks through the path from a Java program to the Linux kernel, detailing how the JVM is launched, how libjvm.so is loaded, how pthread_create maps to the clone system call, and what kernel resources are shared by Java threads.
CloneJVMLinux kernel
0 likes · 14 min read

This article explains the concept of deadlocks, outlines the four necessary conditions, and demonstrates a step‑by‑step Linux workflow using pstack and gdb together with a sample pthread program to identify, analyze, and fix cross‑locking deadlock scenarios.
ConcurrencyLinuxdeadlock
0 likes · 16 min read


ITPUBJan 19, 2017 · Fundamentals
This article explains what a deadlock is, outlines its four necessary conditions, provides a sample pthread program that deadlocks, and shows step‑by‑step how to use pstack and gdb on Linux to identify the stuck threads and understand the root cause.
deadlockgdbpstack
0 likes · 14 min read


ITPUBMay 19, 2016 · Fundamentals
This article explains how to use Linux pthread condition variables, covering initialization, the pthread_cond_wait function, signal handling, and a complete C example that demonstrates thread coordination and mutex interaction for reliable multithreaded programming.
C++LinuxMultithreading
0 likes · 5 min read
