4 ms·
Nice post. Simply written and easy to understand. There are two others: - http://benbowen.blog/post/cmmics_i/ http://benbowen.blog/post/cmmics_i/ - http://be
by jsingleton 10y ago
Nice post. Simply written and easy to understand.
There are two others:
- http://benbowen.blog/post/cmmics_i/ http://benbowen.blog/post/cmmics_i/
- http://benbowen.blog/post/cmmics_ii/ http://benbowen.blog/post/cmmics_ii/
It's well worth learning about the Interlocked class if you want to do parallel programming. If you get it wrong then you will see incorrect/corrupt results. It's also worth keeping in mind that for simple tasks it can be quicker to do them single threaded, due to the overheads involved. I demonstrated this in a simple benchmark app [0] that I wrote for a chapter of my book on ASP.NET Core [1].
[0]: https://github.com/PacktPublishing/ASP.NET-Core-1.0-High-Performance/blob/master/Chapter%206/ParallelBenchmarking/ParallelBenchmarking/src/ParallelBenchmarking/Program.cs https://github.com/PacktPublishing/ASP.NET-Core-1.0-High-Per...
[1]: https://unop.uk/book/ https://unop.uk/book/