File tree Expand file tree Collapse file tree 4 files changed +2
-46
lines changed Expand file tree Collapse file tree 4 files changed +2
-46
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ edition = "2021"
88[dependencies ]
99async-channel = " 1.7.1"
1010async-priority-channel = " 0.1.0"
11- atomic_mpmc = " 0.2.0"
1211broadcaster = " 1.0.0"
1312crossfire = " 0.1.7"
1413flume = " 0.10.14"
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ fn main() {
88
99 crossfire_mpsc ( ) ;
1010 crossfire_mpmc ( ) ;
11- atomic_mpmc ( ) ;
1211 flume_example ( ) ;
1312 async_channel_example ( ) ;
1413 async_priority_channel_example ( ) ;
Original file line number Diff line number Diff line change @@ -74,49 +74,7 @@ pub fn crossfire_mpmc() {
7474 } ) ;
7575}
7676
77- // rx can't aware tx close
78- pub fn atomic_mpmc ( ) {
79- // let (tx, rx) = channel::<i32>(10);
80-
81- // let mut sender_handles = vec![];
82- // for v in 0..4 {
83- // let tx = tx.clone();
84- // let handle = thread::spawn(move || {
85- // for i in 0i32..10 {
86- // if i % 5 != v {
87- // continue;
88- // }
89- // let _ = tx.send(i).unwrap();
90- // println!("thread {} atomic_mpmc sent {}", v, i);
91- // }
92- // });
93-
94- // sender_handles.push(handle);
95- // }
96-
97- // let mut handles = vec![];
98- // for i in 0..4 {
99- // let rx = rx.clone();
100- // let handle = thread::spawn(move || loop {
101- // if let Ok(_i) = rx.recv() {
102- // println!("atomic_mpmc thread {} recv {}", i, _i);
103- // } else {
104- // println!("atomic_mpmc rx closed");
105- // break;
106- // }
107- // });
108- // handles.push(handle);
109- // }
110-
111- // for handle in sender_handles {
112- // handle.join().unwrap();
113- // }
114- // drop((tx,rx));
115-
116- // for handle in handles {
117- // handle.join().unwrap();
118- // }
119- }
77+
12078
12179// has issues.
12280pub fn broadcaster ( ) {
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ futures = "0.3.25"
2727oneshot = " 0.1.5"
2828portable-atomic = { version = " 0.3" , features =[" float" ] }
2929process_lock = " 0.1.0"
30- scc = " 0.11.1 "
30+ scc = " 1.5.0 "
3131sharded-slab = " 0.1.4"
3232simple-mutex = " 1.1.5"
3333singleflight = " 0.2.0"
You can’t perform that action at this time.
0 commit comments