Top "Pthreads" questions

Pthreads (POSIX Threads) is a standardised C-based API for creating and manipulating threads.

Is Pthread library actually a user thread solution?

The title might not be clear enough because I don't know how to define my questions actually. I understand Pthread …

multithreading pthreads kernel
How to continue one thread at a time when debugging a multithreaded program in GDB?

I have a program which uses two threads. I have put the break point in both the threads. While running …

linux multithreading gdb pthreads
Is there an invalid pthread_t id?

I would like to call pthread_join for a given thread id, but only if that thread has been started. …

linux pthreads
Sleeping in a Thread (C / POSIX Threads)

I am developing a multithreaded application that makes use of POSIX Threads. I am using threads for doing a periodical …

c multithreading pthreads sleep usleep
C Confused on how to initialize and implement a pthread mutex and condition variable

I'm a little bit confused on how to initialize and implement a pthread mutex and condition variable. The goal of …

c pthreads conditional-statements mutex producer-consumer
Why are threads called lightweight processes?

A thread is "lightweight" because most of the overhead has already been accomplished through the creation of its process. I …

c multithreading pthreads
Preemptive threads Vs Non Preemptive threads

Can someone please explain the difference between preemptive Threading model and Non Preemptive threading model? As per my understanding: Non …

linux multithreading unix pthreads
producer-consumer problem with pthreads

I'm attempting to solve the producer-consumer problem using pthreads and semaphores, but it looks like the producer threads aren't producing, …

c multithreading pthreads producer-consumer
why pthread causes a memory leak

Whenever I create a pthread, valgrind outputs a memory leak, For example the below code: #include <stdio.h> #…

c memory-leaks pthreads posix valgrind
condition variable - why calling pthread_cond_signal() before calling pthread_cond_wait() is a logical error?

It's written in POSIX threads tutorial https://computing.llnl.gov/tutorials/pthreads/ that it is a logical error. my question …

c++ c pthreads condition-variable