Task Graph System Question

Just a simple questoin about the Task Graph system. I’m curious if my understanding of it is correct, I’ll just put it out there and hopefully someone who knows can tell me if I’m mostly right,completely wrong, or correct me if somewhere in between.

My understanding is that the Task Graph System must complete all of it’s tasks per frame, that it blocks the game thread until that criteria is met. For example, if every frame I add a task that takes 2 seconds into the Task Graph, that it will add (at least) 2 seconds in-between every frame.

My understanding that this is because the Task Graph System is designed for processing short running processes frame-by-frame both synchronously and concurrently in order process more of them in a short time-frame as opposed to a “thread” which is more suitable to long running tasks to be run in parallel to the game thread, so you can do heavy work without blocking and adding that hypothetical 2 seconds between every frame in the example above.

Is this mostly correct? If not where did I go wrong?

I feel pretty confident about my understanding so I do have a question. Is it safe to add a Task to the Task Graph from outside of the game thread? It seems to me that queueing up tasks from a long running process would be a rather safe and elegant way to move const values (note: not variables, values) from some thread’s address space into the game thread’s address space. Seeing as access to the TaskGraph itself is all wrapped around a neat interface I can’t really imagine why it wouldn’t be…

anyone ???

I believe that this is not completely true. Unless you explicitly make Game Thread to wait for any task to be completed, then yes, Game Thread will wait for undefined time. But if your task just adds some work to Game Thread Queue, then Game Thread will execute this in current frame if the step for it was not yet handled, or in the next frame. That’s actually queues are really here