Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Where are the locks or a semaphore?

I have a critical section that needs mutual exclusion. Whats the UE way to-do this. The documentation is very sparse on threads and mutxes.

for the super lazy. I just need to know the headers, or the class name. or hell half of a class name.


Product Version: Not Selected
more ▼

asked Sep 05 '16 at 08:04 PM in Using UE4

avatar image

81 2 5 11

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

On windows. that would be WindowsCriticalSection.h for FCriticalSection::Lock() and FPlatformProcess::Semaphore()

If you are looking for the definitions of other platforms, try doing a ctrl+shift+f search in visual studio, targeting the whole solution. If you have ue4's source available for searching it will show up in no time.

more ▼

answered Sep 05 '16 at 09:09 PM

avatar image

1.1k 41 34 76

avatar image xAnnihilationx Sep 05 '16 at 10:30 PM

Well crap, seems like XBOX and PS4 would be out.

avatar image Spiris Sep 06 '16 at 12:18 AM

Don't give up just yet. Check out their async implementation. They have most everything single threaded platforms should need.
https://docs.unrealengine.com/latest/INT/API/Runtime/Core/Async/index.html. Also I glanced over a single threaded implementation of FRunnable in the engine source at one point. Basically just keep looking, I am sure what you want is there.

avatar image xAnnihilationx Sep 06 '16 at 07:32 PM

Thanks! I ended up just creating a queue and storing requests to the critical section and then a service is run as a one shot timer every second or so. That service will pull one thing off the queue and grant it entry to the critical section and then when its finished the critical section re-invokes the service and so on until the queue is empty at which time the service reschedules itself.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question