New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the conceptual difference between Executor and Builder? #152
Comments
From what I can see, /// A step in a schedule.
pub enum Step {
/// A batch of systems.
Systems(Executor),
/// Flush system command buffers.
FlushCmdBuffers,
/// A thread local function.
ThreadLocalFn(Box<dyn FnMut(&mut World, &mut Resources)>),
/// A thread local system
ThreadLocalSystem(Box<dyn Runnable>),
} Note that one of the step types is an |
@Rua thanks this is helpful. |
Looking at how
Those last two seem somewhat odd, so I wonder if this is a bug @TomGillen ? |
@Rua thanks again. I've got what I wanted from this issue but I will leave it open as there is an outstanding question for @TomGillen. Feel free to close it once this has been answered. |
This is probably a bug. It should either flush for both or neither.
The builder is converted into a schedule via |
Ah yes, I missed that bit. Disregard the last point then. |
@TomGillen I see in 42a0573 that you fixed the bug and added documentation, but the documentation text seems a bit misleading to me. It doesn't actually flush the systems' command buffers when inserting these steps, it merely commits them into an Another oddity I noticed in Schedule::builder()
.add_thread_local(A)
.add_system(B)
.add_thread_local(C)
.flush()
.build() A user might expect the command buffers to be executed in the order A B C. But |
Ah, yes, the documentation is wrong. It shouldn't say that it flushes the command buffers.
Are you sure about that? I can't reproduce it. |
Oh wait, command buffers are flushed in the wrong order, not the system executed? Yea, it'll do that, and it probably shouldn't... |
A
Builder
can be used to compose a bunch ofSystem
s which are allSchedulable
.It seems that (I may be wrong on this one because it is not yet explicitly documented as far as I can tell) that
System
s can be grouped betweenflush
calls and thatSystem
s within such a group are executed in parallel (by default) and the groups themselves are executed sequentially.Have I got that right?
An
Executor
is something that "Executes a sequence of systems, potentially in parallel, and then commits their command buffers."These seem to fulfill the same purpose to me. Is one being deprecated or do they have different use cases?
Also, I am happy to take a stab at expanding the readme.md and/or the hello_world example with something that clarifies this, once I understand it.
The text was updated successfully, but these errors were encountered: