Adding more details and findings…
Since this is a blocking matter for us at the moment, blocking our delivery, I went ahead into the code. I added more traces to confirm the diagnosis :
{
/** Critical section that guards against concurrent adds from multiple threads */
FTransactionallySafeCriticalSection CriticalSection;
int AcquireSectionDepth = 0;
public:
/** Hash sets */
TBucketMap<int32> Hash;
TMultiMap<int32, uint32> HashOuter;
…
FORCEINLINE void Lock()
{
TRACE\_CPUPROFILER\_EVENT\_SCOPE\_STR (\_\_FUNCTION\_\_);
CriticalSection.Lock();
if (0 \=\= AcquireSectionDepth)
{
TRACE\_CPUPROFILER\_EVENT\_SCOPE\_STR (\_\_FUNCTION\_\_ ": ACQUIRE")
int CurrentLength \= Hash.Num ();
}
\+\+AcquireSectionDepth;
}
FORCEINLINE void Unlock()
{
TRACE\_CPUPROFILER\_EVENT\_SCOPE\_STR (\_\_FUNCTION\_\_);
\-\-AcquireSectionDepth;
if (0 \=\= AcquireSectionDepth)
{
TRACE\_CPUPROFILER\_EVENT\_SCOPE\_STR (\_\_FUNCTION\_\_ ": RELEASE")
int CurrentLength \= Hash.Num ();
}
CriticalSection.Unlock();
}
The behavior is quite explicit :
At the frame level, the GT is blocking on the critical section acquisition
[Image Removed]
As far as I can see, within the section is acquired at the beginning of CreateExport method : [Image Removed]All subsequent lock are reentrant until the lock gets released at the end :
[Image Removed]
It seems like a defect to me that an asynchronous thread may hold a critical section used by the main thread (note we do not have any single Color Correct Regions in our applications !) for a duration in multi milliseconds order of magnitude (and obviously not few hendreds milliseconds…)
Please advise.
Also, it would be nice to understand what in our content is leading to this massive preload time. There is a chance we can refactor things on that front if that may help.
Thanks in advance,
Basile