7 ms·
Does anyone have resources related to learning concurrency ? I've had a very short introduction to pthreads in a CS class, but it was too succinct to get any p
by marios 6y ago
Does anyone have resources related to learning concurrency ?
I've had a very short introduction to pthreads in a CS class, but it was too succinct to get any practical benefit IMO. Knowing that a mutex can be used to limit access to a shared variable is easy enough to understand.
How to structure software that runs concurrent tasks is still a mystery to me. Code I've written that uses threads appears to work but I'm not confident I haven't introduced a deadlock in there that's just waiting the worst possible timing to trigger. For instance, the pthreads manpage does a good job at listing the available functions. I have no idea when they should be used though.
If anyone can point me to learning resources around concurrency (books, presentations, talks, sample open source software that does good use of concurrency patterns, ... anything goes, really) I will be eternally grateful.
- percentcer 6y agoI found C++ Concurrency in Action to be pretty helpful. Also if you're able to run TSan it'll really shine a light on your code and will help you sleep more easily. (https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual https://github.com/google/sanitizers/wiki/ThreadSanitizerCpp..., currently built into clang I believe)
- macintux 6y agoThis book give a broad overview of the problem space: https://pragprog.com/book/pb7con/seven-concurrency-models-in-seven-weeks https://pragprog.com/book/pb7con/seven-concurrency-models-in... Also because I have it, here’s a distributed systems meta-reading-list. It’s old and thus I’m sure there are some broken links, but it’s a deep rabbit hole if you’re interested in distributed systems, which is basically concurrency on steroids. https://gist.github.com/macintux/6227368 https://gist.github.com/macintux/6227368
- trevyn 6y agoTry learning Rust? It pretty much forces you to think about safe concurrency. https://doc.rust-lang.org/book/ch16-00-concurrency.html https://doc.rust-lang.org/book/ch16-00-concurrency.html