|
![](/i/fill.gif) |
Le 06/01/2011 09:27, Anthony D. Baye a écrit :
> is it a multi-threaded process (logic seems to dictate that it would be)
>
> If so, I think there's a slight bug (Very minor issue) in the reporting because
> on my dual-core machine it seems to be reporting two different values
> alternately.
>
> My almost non-existent knowledge of parallel processing is giving me the notion
> that each thread is printing separately.
Two threads updating the same counter would need a mutex to protect the
counter, defeating the purpose of multi-threading (well, the mutex would
become the bottleneck).
IMHO, the report of the increasing counter(s) is just to make the user
happy about the progress. It has no added value when compared to a
rotating bar ( | / - \ ). But even a rotating bar updated by 2 or more
threads would need a mutex to provide the rotation. In fact even a
flashing char ("*" alternating with a space) would flash at irregular
interval with multiple threads and no mutex.
Post a reply to this message
|
![](/i/fill.gif) |