Simul Support ExchangeCategory: Sky and Lightingtruesky_queries in TrueSkyPlugin.cpp is thread safe?
cse asked 2 years ago

we have a crash about truesky_queries.
i wonder if the truesky_queries is thread safe.
According to the source, truesky_queries are being accessed simultaneously by RenderThread and MainThread.
in RenderThread
//TrueSkyPlugin.cpp -> RenderFrame(
if(StaticProcessQueries)
{
   for(auto &q:truesky_queries)
  {
     StaticProcessQueries(1,&q.Value);
  }
}
 
and in MainThread
//TrueSkySequenceActor.cpp => GetFloatPropertyAtPosition,CleanQueries,etc…
for(auto q:truesky_queries)
{
   if(GFrameNumber-q.Value.LastFrame>100)
   {
      truesky_queries.Remove(q.Key);
      break;
   }
}
I wonder if the crash was caused by a non-threadsafe issue.

2 Answers
Best Answer
Roderick Kennedy Staff answered 2 years ago

This function is not thread-safe. It will be fixed in the next update.

Wayne Littler Staff answered 2 years ago

Hi CSE,

We will look into this. In the meantime, we have sent you an invite to your company’s dedicated Slack support channel.