How do you fare with pthreads Jow Forums?
How do you fare with pthreads Jow Forums?
>photo of a screen
Why do retards do this?
kek
Pretty well, thanks for asking.
I am at work, and I didn't bring a cable to send the screenshot to my phone with
pthread_joint made my day
pthread_join takes pthread_t, not pthread_t*
>Asking for help on Jow Forums at work
I hope they fire you. People watching streams on twitch at work are less annoyingly autistic
well, at least he's on topic.
I have never made a post in stack overflow
As you shouldn't. Read the documentation until you have a real question to ask.
I don't understand why you're so butthurt
i use openmp like any other sane weeb
made simple thread pool once with pthreads.
You should consider C11 threads though or openmp.
I'm working with a very peculiar recursive algorithm (it is a Branch and bound algorithm called SIVIA) that needs to create threads all the time. Performance matters the most.
Sadly a threadpool with a common stack causes a race condition, mutexes are unavoidable
I'd rather read pthc than pth
>Sadly a threadpool with a common stack causes a race condition, mutexes are unavoidable
Use a singly-linked list. Push to it with a compare-and-swap on the head. Pop by pulling out the entire list, remove one or more items, push back any leftovers. You'll need some mechanism to sleep/wake worker threads (like a semaphore), but otherwise no mutexes.
use TBB
Isn't it possible that 2 threads will try to pull the same list?
nigga just use atomic references
MOOOOOOOOOOOOOOOOOOOOOOODS