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"

FRunnableThread - Should I Pause the Thread or use Shutdown?

I have a function that I call at regular intervals (once per second) it takes anywhere from 100ms to 500ms to run which is why I decided to use FRunnableThread. What I want to know is should I pause the thread and call Run() each time or should I Shutdown the thread and create a new thread each time I need to call the function? I would also like to know if FRunnableThread is the best choice for this type of task?

Product Version: UE 4.19
more ▼

asked Jul 15 '18 at 01:19 PM in C++ Programming

avatar image

11 1 3 5

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

1 answer: sort voted first

Threading that kind of function is certainly fine to do. Starting up and creating threads does take both time and memory allocations. As long as the threading system is getting properly cleaned up between executions it should be a big deal but Suspending and then resuming on repeated executions would avoid that, so long as you are confident in how robust your resuming logic is. I really don't think starting 1 new threads once per second will end up being a major drain on resources as long as you are careful to make sure it is getting cleaned up properly each time.

more ▼

answered Jul 16 '18 at 04:49 PM

Brian Johnstone (suspended)
(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