{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreif6wxu2crla6mo2j5buduxs6geysvzzintqre6vcmxnvhsl2sfy7i",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mgfw3rqjp4u2"
},
"path": "/t/idea-lock-free-std-collection/24056#post_6",
"publishedAt": "2026-03-06T00:29:18.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "Compared to e.g. Java `std` is lacking just about _any_ shared-mutability collection in the first place. However, curiously but without quantification I think that observation holds across the ecosystem, too. Anecdotally for bloom filters, count-min-sketch, and hyperloglog implementations, despite that parallel use being a rather prominent application and there being specifically distributed variants addressing cache hierarchies, false, and true sharing, many crates implementing them provide an interface either based on `&mut self` or are not sync.\n\nThe interoperability argument seems weak without a concrete example. Moving these into the standard library would not magically make them better and: which interface would pass a concurrent data structure across crates, not offer an opaque wapper for it? The comparison to `Vec`, which is a buffer for `String`, `Read` in `std`, and has specialization to make `into_iter()` (and conversely `extend`) efficient, is a rather large leap of logic. All of those motivate it being an actual vocabulary type of sorts. `Arc` in comparison is already less motivated but it gives us stable unsizing and some std-os modules can build on it. What's the tie-in for lockfree data structures?\n\nMaybe consider if, instead, a specific lack of deeper core routines / types contributes to the disconnect between the two worlds that should be addressed first. Rust makes it easier to work on exclusively owned data, in general that is by design and good. However, for another more _special_ class of algorithms are we missing something–apart from the obviously hard atomic unordered / memcpy, is there some safe core abstraction that we can already provide to facilitate?",
"title": "Idea : Lock Free STD Collection"
}