Lots of confusing stuff about concurrency and parallelism - #1143
colinleach wants to merge 6 commits into
Conversation
|
I'm also currently finding out how big of a concept this really is, in the context of GPU programming 😅
I agree this should likely be split up. My initial thought is to break it up into (at least) two parts:
I had initially envisioned having a separate concept on channels, since they are useful outside of multithreading, namely for collecting/iterating graphs. They are the equivalent to Python's
I thought I had opened a PR with this idea on
I think this is a good way forward. If we were going to do the split above, it feels like these two would fall into the |
|
I'll keep adding to this document, at least for the next few days:
Not much progress on finding relevant exercises on other tracks.
Neither is ideal for our needs, but may inspire some ideas. |
|
I think I've gone about as far as I can at the moment. The main gaps are to do with channels, where I need to go away and practice with some real code to understand them better. Also, the distributed stuff is mostly TODO, but that's off-topic in any case. It may be time to try implementing |
|
There is now a Forum discussion with several interesting suggestions. I'll keep working on the two practice exercises. We also need to look more closely at x86/opening-night, which tackles atomic operations from a super-low level. Maybe something we could adapt: a compare and contrast with both locks and atomics in the same exercise??? @BethanyG posted a long list of links, which will need more time to look through properly. At a minimum, there is stuff in there which is well worth reading for my own education, and maybe some ideas for exercises. It also jogged my memory that I have a print copy of "C# Concurrency" on my bookshelf, which I should take a closer look at. Also "Parallel and High Performance Computing", though that may be more biased to big-hardware applications: the lead author works at Los Alamos. |
N.B. This is not a PR for formal review!
Think of it as:
Even with what we have so far, I think that you can see that this is not a viable single concept. More like a syllabus in its own right.
It's not immediately obvious how we split it up. The various bits tend to work together, quite closely interwoven.
I'll keep writing (and correcting, as I try to understand it better).
I think it would be good to think about exercises, both concept and practice.
bank-balanceandparallel-letter-frequencyto see how these practice exercises might be implemented. The first uses locks and/or atomics, the latter needs a split-run-reduce (aka scatter-gather) algorithm.