POV-Ray : Newsgroups : povray.beta-test : Radiosity: status & SMP idea : Re: Radiosity: status & SMP idea Server Time
28 Jul 2024 20:25:21 EDT (-0400)
  Re: Radiosity: status & SMP idea  
From: Warp
Date: 22 Dec 2008 08:03:47
Message: <494f9033@news.povray.org>
Chambers <ben### [at] pacificwebguycom> wrote:
> That is, once a variable is created it cannot be modified.  In the case
> of a container, you don't actually change the container; you make a
> copy, set the reference to point to the modified data, and dump the
> original data.

  How exactly does that help? You still have to mutex the copying to
avoid two threads doing it simultaneously. You also have to mutex reading
the data container because you have to avoid reading it while another
thread is copying it (ie. effectively changing its contents, which would
mean that the first thread would get old data, even assuming it won't
access freed memory at any point).

> Would it be faster if different threads rarely accessed the same locked
> data?

  AFAIK the problem with POV-Ray's radiosity is that if all threads don't
have the exact same data, you may get different lighting in different
threads (effectively, you will get squares with slightly different
lightning). If one thread adds samples to the container, other threads
must see it immediately.

  That, of course, introduces another problem: If two threads would want
to sample the same location, only one of them should do it. The other one
should wait for it to finish it (it wouldn't make too much sense for two
threads to calculate the exact same thing), and then they can both use the
same samples. This adds an additional level of complexity.

-- 
                                                          - Warp


Post a reply to this message

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