crossbeam
crossbeam copied to clipboard
i need use an Map struct,Which one should I use?
i need use an Map struct,Which one should I use。 the Map struct must impl Sync and Send,and do not use '&mut self' just like SegQueue
Crossbeam does not provide this but I happen to do research on this stuff. There are a few libraries available. I've devised benchmarks for all good ones I could gather here. So run the benchmarks and pick whichever you fancy from the list in the readme.
Crossbeam does not provide this but I happen to do research on this stuff. There are a few libraries available. I've devised benchmarks for all good ones I could gather here. So run the benchmarks and pick whichever you fancy from the list in the readme.
These libraries enforce the use of custom drops. if crossbeam can support SyncMap just like golang's SyncMap . Even if write is locked, read is unlocked, or GC It's going to be great
? I don't understand. Everything relies on cust drops. The dashmap library is as close to syncmap as you will get.
? I don't understand. Everything relies on cust drops. The dashmap library is as close to syncmap as you will get.
fine thank you
? I don't understand. Everything relies on cust drops. The dashmap library is as close to syncmap as you will get.
DashMap is implemented using read-write locks . my project also use of tokio(actix-web). if use RwLock it will be lock the runtime(may be lock stop all of async task). The best way to do this is to do it lock-free,just like corssbeam's lock-free Queue?
if use RwLock it will be lock the runtime(may be lock stop all of async task)
You can just run this code on special tokio threadpool for blocking code.
if use RwLock it will be lock the runtime(may be lock stop all of async task)
You can just run this code on special tokio threadpool for blocking code.
But it's not a good idea
See https://crates.io/crates/crossbeam-skiplist for map/set in crossbeam. See crates mentioned in https://github.com/crossbeam-rs/rfcs/issues/32 for concurrent hashmap (crossbeam currently doesn't provide concurrent hashmap).