From 1f95bd768444a4a0318951c2e76f3d28bbf3763a Mon Sep 17 00:00:00 2001 From: Ben Blum Date: Mon, 5 Aug 2013 16:55:08 -0400 Subject: Lazily initialize 'leaf node' taskgroups for unlinked spawns, for an apparent 11% speedup. --- src/libstd/rt/kill.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libstd/rt') diff --git a/src/libstd/rt/kill.rs b/src/libstd/rt/kill.rs index ef2d0de5312..3372c13b877 100644 --- a/src/libstd/rt/kill.rs +++ b/src/libstd/rt/kill.rs @@ -193,6 +193,10 @@ impl BlockedTask { /// Create a blocked task, unless the task was already killed. pub fn try_block(mut task: ~Task) -> Either<~Task, BlockedTask> { + // NB: As an optimization, we could give a free pass to being unkillable + // to tasks whose taskgroups haven't been initialized yet, but that + // introduces complications with select() and with the test cases below, + // and it's not clear the uncommon performance boost is worth it. if task.death.unkillable > 0 { Right(Unkillable(task)) } else { -- cgit 1.4.1-3-g733a5