about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorBen Blum <bblum@andrew.cmu.edu>2013-08-05 16:55:08 -0400
committerBen Blum <bblum@andrew.cmu.edu>2013-08-05 19:30:25 -0400
commit1f95bd768444a4a0318951c2e76f3d28bbf3763a (patch)
treeca7e37a881344bb7a8323acd3f0f99e00e7efc5e /src/libstd/rt
parent47e82c85555895c21206c84b62cac19eb351d1b8 (diff)
downloadrust-1f95bd768444a4a0318951c2e76f3d28bbf3763a.tar.gz
rust-1f95bd768444a4a0318951c2e76f3d28bbf3763a.zip
Lazily initialize 'leaf node' taskgroups for unlinked spawns, for an apparent 11% speedup.
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/kill.rs4
1 files changed, 4 insertions, 0 deletions
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 {