From https://udn.unrealengine.com/questions/292741/fmultireadersinglewritergt-isnt-thread-safe.html:
I've found that FMultiReaderSingleWriterGT has at least 2 bugs:
The one that caused a deadlock in our game and caused me to investigate was this:
This is deadlocked because ReadCounter is 0, but Action is left set as ReadingAction when the game thread releases the lock. Removing the IsInGameThread() guards in LockRead() and UnlockRead() would fix this.
I also noticed there is also a more standard problem that occurs with these kinds of lock, that the control data isn't guarded, so you can get two threads modifying the lock in this pattern:
Result: Thread 2 is reading, but lock is set to NoAction.
N/A
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-30929 in the post.
0 |
Component | UE - Foundation - Core |
---|---|
Affects Versions | 4.10, 4.11 |
Target Fix | 4.15 |
Created | May 17, 2016 |
---|---|
Resolved | Nov 30, 2016 |
Updated | Apr 27, 2018 |