Task queueing best practices

anonymous_user_e1690214
Mon, 06 Oct 2014 10:58:33 +0000
Pipeline & Plugins

I’m making an in-editor tool which will frequently need to perform large processing tasks. I’d like to do them asynchronously on a separate thread (or threads), to keep the editor as responsive as possible. My assumption is that the task system is best for this, particularly since the beginning and end bits of each process do need to execute on the GameThread.

My questions:

1. Is there any benefit to creating a separate thread or threads specifically to handle the tasks from my tool? If so, should that be done by creating a new ENamedThread enumerant, or in some other way?

2. How many worker threads are there to handle tasks which are dispatched for ENamedThreads::AnyThread? Is that number controllable?

3. Will long-running tasks on GameThread block the editor’s responsiveness? Will they block the responsiveness of editor tasks, such as moving objects in the world? Will calling FGraphEvent::DontCompleteUntil from such a task block other tasks on the GameThread until the waited-for event fires?

4 posts - 1 participant