4 ms·
After reading this book, I built a high throughput, multi-threaded processing system in C++ that didn't use any mutex because I was able to define my operations
by mempko 7y ago
After reading this book, I built a high throughput, multi-threaded processing system in C++ that didn't use any mutex because I was able to define my operations as both commutative and associative. Because I was able to start thinking at that level thanks to this book it led me to a better design of my system.
It's worth reading, you will get something out of it! But it is a lot of work!
- _fullpint 7y agoThat's really cool! Do you mind maybe explain how you were able to communicative and associative props to avoid using semaphores/mutex? There seems to be a lot of complaints here about the formality of it all. My preference is usually for more formal literature, just because it tends to lend for a more powerful tool for me. With that said, did you find it to be too formal?
- mempko 7y agothose properties allow you to divide up work on data in a way that guarantees that no two processes will work on the same data at the same time. You can then take data, divide it up, use 'const correctness' in the language to guarantee original data doesn't change and then you don't need a mutex because you know only one thread is working on that piece of data. A typical approach is if you can divide your algo into map/reduce, you can do this. Going back to the properties of you computation allows you to reason how to apply something like map/reduce.