
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
This crates provides a sequentially locking Ring Buffer. It allows for a fast and non-writer-blocking SPMC-queue, where all consumers read all messages.
This is the Rust-wrapped Zig version of the sling crate. Note that due to current constraints in the implementation, the buffer size is set to 256 and the and messages are set to [u8; 8].
There are two ways of consuming from the queue. If threads share a
SharedReader
through a shared reference, they will steal
queue items from one anothers such that no two threads will read the
same message. When a SharedReader
is cloned, the new
SharedReader
's reading progress will no longer affect the other
one. If two threads each use a separate SharedReader
, they
will be able to read the same messages.
# use zsling::*;
let buffer = RingBuffer::new();
let mut writer = buffer.try_lock().unwrap();
let mut reader = buffer.reader();
std::thread::scope(|s| {
let reader = &reader;
for t in 0..8 {
s.spawn(move || {
for _ in 0..100 {
if let Some(val) = reader.pop_front() {
println!("t: {}, val: {:?}", t, val);
};
}
});
}
for i in 0..100 {
writer.push_back([0, 1, 2, 3, 4, 5, 6, 7]);
}
});
It is also important to keep in mind, that slow readers will be overrun by the writer if they do not consume messages quickly enough. This can happen quite frequently if the buffer size is not large enough. It is advisable to test applications on a case-by-case basis and find a buffer size that is optimal to your use-case.
FAQs
Unknown package
We found that zsling demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.