I'm assuming this yield flag is primarily for timeouts, correct? What other
ways are there to set the yield flag?
I was reading some about Erlang today and it looks like they way they handle timeouts is to let each program
run for a certain number of "reductions." If we wanted to fix the timeslice at compile time, we
could use a similar approach. We could simply insert yields every N instructions, and for loops we could say
"this loop body is 15 instructions, so we need to make sure to yield every N/15 iterations." It
seems like this would make the "yield flag" mostly unnecessary.
Remember that we are producing LLVM and that LLVM has no idea what a
call to yield is.
I guess the other reason we need a yield flag is to let tasks kill each other.
Is there a chance we could handle this in the scheduler? I guess it would
probably amount to doing the yield flag check somewhere else. That said, look
at it this way makes me think it's probably not any more expensive than vector
bounds checks.
-Eric
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev
Cheers,
Rafael
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev