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
3
3
4
4
script :
5
5
- 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;
30
30
use std:: ptr;
31
31
use std:: sync:: mpsc:: { self , Receiver , Sender } ;
32
32
use std:: thread:: { self , Builder } ;
33
- use std:: time:: Duration ;
34
33
35
34
use deque:: { BufferPool , Stolen , Worker , Stealer } ;
36
35
@@ -330,10 +329,19 @@ impl Processor {
330
329
}
331
330
}
332
331
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
+ } ;
337
345
}
338
346
339
347
self . is_scheduling = false ;
You can’t perform that action at this time.
0 commit comments