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?
asked Jul 15 '18 at 01:19 PM in C++ Programming
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.
answered Jul 16 '18 at 04:49 PMBrian Johnstone (suspended)
Follow this question
Once you sign in you will be able to subscribe for any updates here