Shared - Another Thread

Stanislav Blinov stanislav.blinov at gmail.com
Thu Oct 18 17:01:46 UTC 2018


On Thursday, 18 October 2018 at 16:31:33 UTC, Vijay Nayar wrote:

> Imagine a simple algorithm that does logic on very long 
> numbers, split into bytes.  One multi-threaded implementation 
> may use 4 threads.  The first operating on bytes 0, 4, 8, etc.  
> The second operating on bytes 1, 5, 9, etc.
>
> In this case, a mutex or lock isn't actually needed, because 
> the algorithm itself assures that threads don't collide.

Yes, they do collide. You just turned your cache into a giant 
clusterf**k. Keyword: MESIF.


More information about the Digitalmars-d mailing list