abroder_1
(AaonBroder)
March 18, 2015, 3:01am
1
All I’ve been able to find are FSemaphores defined in FGenericPlatformProcess and it seems like there’s only a platform implementation for Windows . I’m hoping to find some implementations of mutexes and semaphores that at least exist for Mac/PC/Linux and Android.
Thanks!
Hmm maybe post feature request on feedback forum, or if you up to it write implementations to other platfroms and submit pull request
Mattlauk
(Mattlauk)
August 8, 2015, 5:25pm
3
Bumb. Yeah. It’s kinda frustrating that a multi platform engine would implement something like this for only a single platform.
Well without common implementation in UE4 you are forced to learn and use platfrom specific either way
Moss
(Moss)
August 8, 2015, 8:53pm
5
There actually is, it’s called FEvent
and represents a simple signaling primitive. It’s used for example to ensure the game thread waits for the render thread.
There are other primitives such as FScopedEvent
or FThreadSafeCounter, have a look into ThreadingBase.h
.
You have even FPlatformMisc::MemoryBarrier();
supported in every platform.
Mattlauk
(Mattlauk)
August 8, 2015, 8:06pm
6
Oh if I only knew how they worked on other platforms. I guess I’ll have to learn someday.
In case that someone needs an example on how to use FEvent I made a short Wiki with example: MultiThreading and synchronization Guide