Skip to main content
Code Review

Questions tagged [pthreads]

Pthreads (POSIX Threads) is a standardised C-based API for creating and manipulating threads on a POSIX-compliant system. It is defined by the standard "POSIX.1c, Threads extensions (IEEE Std 1003.1c-1995)", and subsequently by the Single Unix Specification.

Filter by
Sorted by
Tagged with
8 votes
1 answer
99 views

Mandelbrot set visualizer using GTK4, Cairo and POSIX threads in C

I have recently implemented a Mandelbrot set visualizer, which I used to reacquaint myself with multithreading using pthreads. I'm just wondering whether the way ...
3 votes
1 answer
129 views

Multithread execution times are slow on Ubuntu and fast on Windows

I'm working on a project accelerating the execution of a Genetic Algorithm both on multiple cores and on a GPU. The algorithm is specifically suited for the solution of the Traveling Salesman Problem ...
2 votes
3 answers
155 views

Simple rwlock implementation in C

Can someone please review my rwlock implementation to see if there are any issues with correctness (hopefully not), give any feedback on how to write good C code etc, design patterns which could be ...
2 votes
2 answers
260 views

Circular Queue Producer Consumer with Mutex and Condition Variable vs. Sempahore

How can I optimize the performance of the code below? Destruction of the condition variable at the end of main blocks, not sure why this behavior is occurring. Is it possible to remove some of the ...
0 votes
0 answers
114 views

binary semaphores implementation pthread

Can someone see if have not made some stupid mistakes in the binary semaphore implementation? I know that some more checks have to be added but I have eventually lost the initial idea in the details. <...
0___________'s user avatar
2 votes
2 answers
216 views

Wait for child while polling file descriptor with self-pipe controlled by different threads

I am working on a personal project, and one of the things it does is to call a blocking operation on a file descriptor while a forked+exec'ed child process is running. It needs to know when the ...
Seninha's user avatar
  • 171
4 votes
3 answers
502 views

Implementation of pthread multithreading and mutex

I am trying to implement a "proper" pthread multithreading program with pthread mutex. I want it to be as C-standard-conforming and POSIX-conforming as possible. The below is my ...
D.J. Elkind's user avatar
7 votes
2 answers
4k views

Proper implementation of signal handler and multithreading (pthread)

I am trying to implement a "proper" signal handler that works correctly for multiple threads, and to be as C-standard-conforming and POSIX-conforming as possible. The below is my ...
8 votes
2 answers
1k views

Event functionality in C

I am beginner to intermediate and wanted to write a little event code in c. It's one header file with 108 line pure code and it does what I was thinking it should be like for me. EventListener.h ...
1 vote
2 answers
197 views

semaphore barriers exercise os three easy pieces

I am reading the book OS three easy pieces, In the semaphore chapter I am going through barrier.c question. Below is the code that needs to be completed for the desired output: ...
Hackaholic's user avatar
15 votes
2 answers
1k views

A multithreaded implementation of the 'which' command

Here is an implementation of the 'which' command which can tell where programs are located. ...
6 votes
3 answers
988 views

A priority based timer using priority queue

I am trying to implement a priority-based timer where certain events are fired out based on their expiry and the priority. So if there are 3 timers with the following expiry time and priorities Timers ...
4 votes
1 answer
869 views

A tiny threads pool in C

I'm a newbie in C, and currently following Stanford CS107 - Programming Paradigms. For assignment 6, I find it'd be better to isolate the threads management from the service logic. The following code ...
3 votes
1 answer
385 views

Time slice for thread check

A code to check the time slice for each thread separately, it will receive an integer number from the command line for the number of threads to run simultaneously. Would love some feedback on what is ...
SA.93's user avatar
  • 143
4 votes
2 answers
395 views

Thread Synchronization - CPU Usage exceeds 200 - C program

I have a working program that reads user input keys and echoes them back to the screen using the producer/consumer paradigm (the project requires you to use threads). While this program does work, it ...

15 30 50 per page
1
2 3 4 5 6

AltStyle によって変換されたページ (->オリジナル) /