File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed
Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,7 @@ rust: nightly
33
44script :
55 - cargo test -v
6- # - cargo build --manifest-path benchmarks/Cargo.toml -v
6+ - cargo build --manifest-path benchmarks/Cargo.toml -v
7+ - cargo run --example simple
8+ - cargo run --example main_function
9+ - cargo run --example panic
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ use std::mem;
3030use std:: ptr;
3131use std:: sync:: mpsc:: { self , Receiver , Sender } ;
3232use std:: thread:: { self , Builder } ;
33- use std:: time:: Duration ;
3433
3534use deque:: { BufferPool , Stolen , Worker , Stealer } ;
3635
@@ -330,10 +329,19 @@ impl Processor {
330329 }
331330 }
332331
333- // This sleep throttles this loop in case a Processor runs out of work.
334- // TODO: Replace this sleep by some mechanism capable of waking up
335- // idle workers as soon as new work is available.
336- thread:: sleep ( Duration :: from_millis ( 10 ) ) ;
332+ // Wait forever until we got notified
333+ if let Ok ( msg) = self . chan_receiver . recv ( ) {
334+ match msg {
335+ ProcMessage :: NewNeighbor ( nei) => self . neighbor_stealers . push ( nei) ,
336+ ProcMessage :: Shutdown => {
337+ self . destroy_all_coroutines ( ) ;
338+ }
339+ ProcMessage :: Ready ( SendableCoroutinePtr ( ptr) ) => {
340+ self . ready ( ptr) ;
341+ self . has_ready_tasks = true ;
342+ }
343+ }
344+ } ;
337345 }
338346
339347 self . is_scheduling = false ;
You can’t perform that action at this time.
0 commit comments