On 04/26/2013 09:04 AM, Patrick Walton wrote:
On 4/26/13 6:53 AM, Gábor Lehel wrote:
Probably a crazy idea, but would it be possible to do something where if
the parent task launches a child task, and then does nothing else except
wait for the child to finish, it's not actually implemented by launching
a new task, but instead by calling the closure in place?
The new scheduler is designed to allow *almost* this -- `spawn` will
simply grab a cached stack segment (assuming there's one available)
and context switch to the task immediately.
Yeah, and I'm trying to make it so most of the resources held by tasks,
even the task object itself, is cacheable. So when you spawn in an ideal
scenario you occupy the dead husk of some other task and just start
running. We can also probably lazily initialize *all* the local services
(logging, local heap, gc, etc). We're going to have a lot of options to
reduce the expense of spawning once things are written in Rust.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev