POV-Ray : Newsgroups : povray.beta-test : Photon counting : Re: Photon counting Server Time
26 Jun 2024 12:30:16 EDT (-0400)
  Re: Photon counting  
From: Le Forgeron
Date: 6 Jan 2011 03:49:20
Message: <4d258210$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.