direct-io
project-safe-transmute
direct-io | project-safe-transmute | |
---|---|---|
1 | 2 | |
66 | 0 | |
- | - | |
0.0 | 4.1 | |
about 1 year ago | over 3 years ago | |
C | ||
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
direct-io
-
But How, Do Databases Use Mmap?
I wrote this for Node.js, which is a native binding in C, exposing cross platform functionality: https://github.com/ronomon/direct-io
Although if it's a new project and you're used to C, I would recommend also taking a good look at Zig (https://ziglang.org/), because it's so explicit about alignment compared to C, and makes alignment a first-class part of the type system, see this other comment of mine that goes into more detail: https://news.ycombinator.com/item?id=25801542
Something that will also help, is setting your minimum IO unit to 4096 bytes, the Advanced Format sector size, because then your Direct IO system will just work, regardless of whether sysadmins swap disks of different sector sizes from underneath you. For example, a minimum sector size of 4096 bytes will work not only for newer AF disks but also for any 512 byte sector disks.
Lastly, Direct IO is actually more a property of the file system, not necessarily the OS (e.g. Linux), so you will some file systems on Linux that return EINVAL when you try to open a file descriptor with O_DIRECT, simply because they don't support O_DIRECT (e.g. a macOS volume accessed from within a Linux VM) so that should be your way of testing for support, not only the OS.
project-safe-transmute
-
Comparing Rust's and C++'s Concurrency Library
I've seen some skeptic comments about the std::atomic and I agree that such a type should not be allowed to implicitly use locks behind the scenes. I'd rather have a Atomic that is actually atomic and also allows things like Atomic>> through the niche optimization. Something like AtomicCell like mentioned here could still be added if people want this behavior.
-
But How, Do Databases Use Mmap?
It's likely that the "safe transmute" working group[1] will help facilitate this sort of thing. They have an RFC[2]. See also the bytemuck[3] and zerocopy[4] crates which predate the RFC, where at least the latter has 'derive' functionality.
[1] - https://github.com/rust-lang/project-safe-transmute
[2] - https://github.com/jswrenn/project-safe-transmute/blob/rfc/r...
[3] - https://docs.rs/bytemuck/1.5.0/bytemuck/
[4] - https://docs.rs/zerocopy/0.3.0/zerocopy/index.html
What are some alternatives?
httpdirfs - A filesystem which allows you to mount HTTP directory listings or a single file, with a permanent cache. Now with Airsonic / Subsonic support!
wg-allocators - Home of the Allocators working group: Paving a path for a standard set of allocator traits to be used in collections!
imdb-rename - A command line tool to rename media files based on titles from IMDb.
hh-suite - Remote protein homology detection suite.
libuv - Cross-platform asynchronous I/O
MMseqs2 - MMseqs2: ultra fast and sensitive search and clustering suite