Skip to main content

Questions tagged [pthreads]

1 vote
2 answers
166 views

I’m writing a multiplayer server in C using sockets and pthreads. The project is separated by responsibility: server.c/.h → networking (socket, bind, listen, accept, thread creation) player.c/.h → ...
dok's user avatar
  • 311
0 votes
1 answer
246 views

As my next spare-time project, I'm considering writing a suite of compatibility header and associated library, that eases the transition from Single Unix Specification v4 to v5 and C11/C17 to C2X. C++ ...
DannyNiu's user avatar
  • 374
-2 votes
1 answer
394 views

In Computer Systems: a Programmer's Perspective, 12.7.1 Thread Safety When we program with threads, we must be careful to write functions that have a property called thread safety. A function is said ...
Tim's user avatar
  • 5,555
2 votes
0 answers
2k views

i've been wondering about it for a while now but never found any answers. is it possible to use something like a condition variable without a lock? I have a vector of objects, and a thread pool, and ...
Alon Hershkovitz's user avatar
0 votes
2 answers
668 views

I have a thread that goes in a loop doing something like this void thread() { pthread_mutex_lock(mutex); for ( ; ; ) { /** code **/ { pthread_mutex_unlock(mutex); /** ...
cauchi's user avatar
  • 1,232
0 votes
0 answers
1k views

Assuming some pthread_cond_t condvar; properly initialized with pthread_cond_init am I allowed to pthread_cond_broadcast it without any mutex locked and thread blocked with pthread_cond_timedwait on ...
Basile Starynkevitch's user avatar