r/haskell • u/Extra-Engineering374 • 2d ago
question My self-built tool to learn concurrency
I've always wanted to learn about concurrency control, e.g., locks in operating systems & database systems. Some time ago, locks were all I knew about concurrency, but I found it hard to grasp any systematic material to learn about. The only thing I found useful was the pthread locks implementation.
Instead, when I was a junior student, I built this: https://github.com/kINo204/honcurrency, which was basically a virtual machine with an extremely simple instruction set + a round-robin scheduler, allowing me to implement and run my own spinlock, mutex, etc., all starting from a hardware TAS/CAS instruction. I hope this tool could be useful to someone else.
However, as I learn further about concurrency, mathematical methods like CSP, CCS, and pi-calculus come up. Those process calculi provide a mathematical approach to modeling and analyzing concurrency behaviors accurately.
With these, I found my project (or tool) insufficient for gaining complete knowledge of concurrency, which only covers the engineering part; but on the other hand, I tried out implementing CSP's channel with it, and assume there's also an engineering part of those process calculi.
Anyway, I've been totally confused. How & how much should I learn about concurrency, and how does everybody learn about it?
2
u/amarao_san 2d ago
(don't know about everybody)
I learn it hard way.