POV-Ray : Newsgroups : povray.bugreports : crand is not thread safe in any >=3.7 version. Do we care? : Re: crand is not thread safe in any >=3.7 version. Do we care? Server Time
20 Sep 2021 06:43:00 EDT (-0400)
  Re: crand is not thread safe in any >=3.7 version. Do we care?  
From: clipka
Date: 7 Mar 2018 10:47:06
Message: <5aa0097a$1@news.povray.org>
Am 07.03.2018 um 15:18 schrieb William F Pokorny:
> On 03/07/2018 08:23 AM, William F Pokorny wrote:
>> On 03/06/2018 06:44 AM, William F Pokorny wrote:
>>
>> When I get a moment I'll either open up a github issue or a pull
>> request if a quick look at the code shows an easy fix like c++11's
>> thread_local.
>>
> 
> Perhaps best I talk to myself... Turns out there is a separate random
> number generator set up for crand - suppose for speed reasons and that
> the set up intentional. Going to walk away.
> 
> Use +wt1 if using crand and you want 'frame/view' renders to be the same
> render to render.
> 
> Bill P.

Maybe we can concoct something that will keep the crand stable when
using the "+HR" option. While currently only having an effect on
radiosity, the intention of the switch was to also change the behaviour
of any other stuff that's affected by thread assignment and render block
ordering.

My suggestion would be to re-seed the crand noise generator each time a
new block is started, maybe using a seed based on the block number in
order to prevent visible repetitions.


Post a reply to this message

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