veddan / rust-concurrent-hashmap Goto Github PK
View Code? Open in Web Editor NEWA concurrent hash table for Rust
A concurrent hash table for Rust
We're using cargo audit
in our project and today this vulnerability was found:
error: Vulnerable crates found!
ID: RUSTSEC-2019-0013
Crate: spin
Version: 0.4.8
Date: 2019-08-27
URL: https://github.com/mvdnes/spin-rs/issues/65
Title: Wrong memory orderings in RwLock potentially violates mutual exclusion
Solution: upgrade to: >= 0.5.2
I will fork the project and try to see if just updating spin
don't break anything and submit a PR if doesn't.
Adding a build status would be good.
Specifically
{
let accessor = map.find(&x);
map.insert(y, z); // Is deadlock OK? What are the properties of std locks?
}
--> /home/suraj.prakash/.cargo/registry/src/github.com-1ecc6299db9ec823/spin-0.4.6/src/lib.rs:6:30
|
6 | #![cfg_attr(feature = "asm", feature(asm))]
| ^^^^^^^^^^^^^
error: aborting due to previous error
Caused by:
process didn't exit successfully: rustc --crate-name spin /home/suraj.prakash/.cargo/registry/src/github.com-1ecc6299db9ec823/spin-0.4.6/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg feature="asm" -C metadata=f0103624a0e8ce52 -C extra-filename=-f0103624a0e8ce52 --out-dir /home/suraj.prakash/projects/payu_concur/target/debug/deps -L dependency=/home/suraj.prakash/projects/payu_concur/target/debug/deps --cap-lints allow
(exit code: 101)
This crate cannot be found on crates.io looking for "concurrent hash map". Maybe adding some tag would help.
Any formal description in Readme would be very helpful. Thanks
While experimenting with a non-default hasher and ConcHashMap
, I found that the new
method doesn't include the hasher in its type signature. As a result, code like the following:
type MyMap = ConcHashMap<(u64, u64), u8>;
...
let x: MyMap = MyMap::new();
doesn't compile because MyMap::new
returns a type different than MyMap
. This doesn't look intentional and is probably fixed simply by changing the return type of new
from ConcHashMap<K, V>
to ConcHashMap<K, V, H>
.
An easy workaround is to import the Default
trait and use MyMap::default()
instead of MyMap::new()
.
Hi,
Do you have an example on how to use options concurrency, I'd like to increase the 16 to 256 but I can't find a working example, I can't understand the doc properly.
Thank you so much man.
RWLock
s can be slow, Mutex
might be faster. Obviously might depend on read/write ratio. Needs benchmarks.
Last time I checked, lots of time was spent doing virtual calls to access thread-locals (is_panicking) on low-contention scenarios, see rust-lang/rust#25088.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.