Portable atomic types.

Overview

portable-atomic

crates.io docs.rs license rustc build status

Portable atomic types.

  • Provide all atomic integer types (Atomic{I,U}{8,16,32,64}) for all targets that can use atomic CAS. (i.e., all targets that can use std, and most no-std targets)
  • (optional) Provide Atomic{I,U}128. (lock-free on x86_64 and aarch64 at Rust 1.59+)
  • (optional) Provide AtomicF{32,64}.
  • Provide atomic load/store for targets where atomic is not available at all in the standard library. (riscv without A-extension, msp430, avr)
  • (optional, single-core only) Provide atomic CAS for targets where atomic CAS is not available in the standard library. (thumbv6m, riscv without A-extension, msp430, avr)

Optional features

  • fallback (enabled by default)
    Enable fallback implementations.

  • i128
    Provide Atomic{I,U}128.

    Note:

    • 128-bit atomic operations are only available for x86_64 and aarch64 at Rust 1.59+, otherwise the fallback implementation is used.
    • On x86_64, when cmpxchg16b target feature is not enabled at compile time, this uses the fallback implementation. cmpxchg16b is enabled by default only on macOS.
    • This implicitly enables the fallback feature.

    If you need support for dynamic CPU feature detection, use the i128-dynamic feature.

  • i128-dynamic
    Similar to the i128 feature, but tries to use cmpxchg16b in more cases based on dynamic CPU feature detection.

    Note:

    • Dynamic detection is only enabled in nightly, otherwise it works the same as the i128 feature.
    • When cmpxchg16b target feature is enabled at compile time, this works exactly the same as the i128 feature.
    • If both i128 and i128-dynamic features are used in the dependency graph, i128-dynamic takes precedence.
    • This is compatible with no-std (as with all features except std and parking_lot).
  • float
    Provide AtomicF{32,64}. Note that most of fetch_* operations of atomic floats are implemented using CAS loops, which can be slower than equivalent operations of atomic integers.

  • std
    Use std.

  • serde
    Implement serde::{Serialize,Deserialize} for atomic types.

    Note:

    • The MSRV when this feature enables depends on the MSRV of serde.
  • parking_lot
    Use parking_lot in global locks of fallback implementation.

    Note:

    • This is not compatible with no-std.
    • The MSRV when this feature enables depends on the MSRV of parking_lot.

Optional cfg

  • --cfg portable_atomic_unsafe_assume_single_core
    Assume that the target is single-core. When this cfg is enabled, this crate provides atomic CAS for targets where atomic CAS is not available in the standard library.

    Note: This cfg is unsafe, and enabling this cfg for multi-core systems is unsound.

    This is intentionally not an optional feature. If this is an optional feature, dependencies can implicitly enable the feature, resulting in the use of unsound code without the end-user being aware of it.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Comments
  • Can `atomic-polyfill` and `portable-atomic` soundly coexist in the same dependency graph?

    Can `atomic-polyfill` and `portable-atomic` soundly coexist in the same dependency graph?

    Like it or not, atomic-polyfill and portable-atomic both exist as crates solving the same problem of "providing atomic primitives to targets that don't have them" in different ways. The major difference between the two crates is that:

    1. atomic-polyfill depends on critical-section, and expects another crate to define extern functions acquire and release. The critical-sectioncrate uses acquire and release to implement critical sections. If acquire and release aren't defined by an external crate, a link error will occur. In other words, the critical section implementation can be swapped out with another.
    2. portable-atomic implements critical sections for all targets within the portable-atomic crate, and does not defer to an external crate.

    According to reverse dependencies on crates.io, these two crates don't have any shared reverse dependencies, and some of these reverse deps have 10 million+ downloads. This means it's plausible to have both crates in the same dependency graph. And this means it's also plausible that these two crates in the same dependency graph implement critical sections in different ways.

    Is this a soundness problem in practice? I can't visualize one, since types from this crate won't share memory locations with types from atomic-polyfill. But it's enough to get me thinking and open an issue. If it is a soundness issue as opposed to simply "two crates doing the same thing in different ways are in the same dependency graph", is it possible to fail the build if both crates get pulled in, or automatically have portable-atomic be a shim for atomic-polyfill (or vice-versa)?

    C-question 
    opened by cr1901 11
  • interrupt: Optimize restore on AVR and MSP430

    interrupt: Optimize restore on AVR and MSP430

    As we have already been doing for pre-v6 ARM, avoid unneeded branch and mask.

    https://github.com/taiki-e/portable-atomic/blob/d4b27473dd7d62a6d5a453e78b1629a1ce24d086/src/imp/interrupt/armv4t.rs#L31-L40

    O-avr O-msp430 
    opened by taiki-e 8
  • Optimize pre-v6 ARM load/store on single-core systems

    Optimize pre-v6 ARM load/store on single-core systems

    Since pre-v6[^v6] ARM has no Data Memory Barrier and cannot implement atomic in a way compatible with v6 and later multicore CPUs without OS helpers, LLVM generates libcalls for atomic operations that require synchronization, such as Acquire/Release and SeqCst.

    Currently, (when portable_atomic_unsafe_assume_single_core cfg is used) we consider this as "atomic load/store are not available on pre-v6 ARM" and always disable interrupts. However, relaxed load+compiler fence can do this more efficiently since we know it is single-core.

    https://github.com/taiki-e/portable-atomic/blob/e6e1500f440e6a79d87f4471924c5e6613594b51/src/imp/interrupt/mod.rs#L34-L35

    https://github.com/taiki-e/portable-atomic/blob/e6e1500f440e6a79d87f4471924c5e6613594b51/src/imp/interrupt/mod.rs#L23-L29

    FYI @Lokathor

    [^v6]: ARMv6 except for ARMv6-M also does not have the DMB instruction, but there is a special instruction equivalent to DMB.

    O-arm 
    opened by taiki-e 8
  • interrupt: Support no-std pre-v6 ARM targets

    interrupt: Support no-std pre-v6 ARM targets

    Closes #26

    This currently disables only IRQs. This is explained in the document on safety requirements:

    • On pre-v6 ARM, this currently disables only IRQs. Enabling this cfg in an environment where FIQs must also be disabled is also considered unsound.

    I have a few questions:

    O-arm 
    opened by taiki-e 8
  • Use SSE for 128-bit atomic load/store on Intel CPU with AVX

    Use SSE for 128-bit atomic load/store on Intel CPU with AVX

    x86_64 part of #10

    The following are the results of a simple microbenchmark:

    bench_portable_atomic_arch/u128_load
                            time:   [1.4598 ns 1.4671 ns 1.4753 ns]
                            change: [-81.510% -81.210% -80.950%] (p = 0.00 < 0.05)
                            Performance has improved.
    Found 7 outliers among 100 measurements (7.00%)
      1 (1.00%) low mild
      4 (4.00%) high mild
      2 (2.00%) high severe
    bench_portable_atomic_arch/u128_store
                            time:   [1.3852 ns 1.3937 ns 1.4024 ns]
                            change: [-82.318% -81.989% -81.621%] (p = 0.00 < 0.05)
                            Performance has improved.
    Found 10 outliers among 100 measurements (10.00%)
      3 (3.00%) low mild
      5 (5.00%) high mild
      2 (2.00%) high severe
    bench_portable_atomic_arch/u128_concurrent_load
                            time:   [56.422 us 56.767 us 57.204 us]
                            change: [-70.807% -70.143% -69.443%] (p = 0.00 < 0.05)
                            Performance has improved.
    Found 9 outliers among 100 measurements (9.00%)
      3 (3.00%) high mild
      6 (6.00%) high severe
    bench_portable_atomic_arch/u128_concurrent_load_store
                            time:   [136.53 us 139.96 us 145.39 us]
                            change: [-82.570% -81.879% -80.820%] (p = 0.00 < 0.05)
                            Performance has improved.
    Found 15 outliers among 100 measurements (15.00%)
      4 (4.00%) high mild
      11 (11.00%) high severe
    bench_portable_atomic_arch/u128_concurrent_store
                            time:   [146.03 us 147.67 us 149.98 us]
                            change: [-90.486% -90.124% -89.483%] (p = 0.00 < 0.05)
                            Performance has improved.
    Found 9 outliers among 100 measurements (9.00%)
      1 (1.00%) high mild
      8 (8.00%) high severe
    bench_portable_atomic_arch/u128_concurrent_store_swap
                            time:   [765.11 us 766.69 us 768.29 us]
                            change: [-51.204% -50.967% -50.745%] (p = 0.00 < 0.05)
                            Performance has improved.
    Found 7 outliers among 100 measurements (7.00%)
      4 (4.00%) low mild
      2 (2.00%) high mild
      1 (1.00%) high severe
    

    Closes #10

    O-x86 
    opened by taiki-e 8
  • Enable outline-atomics by default and provide cfg to disable it

    Enable outline-atomics by default and provide cfg to disable it

    This enables outline-atomics feature by default and provides portable_atomic_no_outline_atomics cfg to disable it.

    (outline-atomics enables several optimizations on x86_64 and aarch64. See this list for details.)

    It has previously been pointed out that due to the nature of the cargo feature, controlling this based on the cargo feature does not work well. Since this release, outline-atomics feature has been no-op, and outline-atomics is enabled by default.

    Note: outline-atomics in portable-atomics is currently for 128-bit atomics. outline-atomics for atomics with other sizes is controlled by LLVM's outline-atomics target feature.

    Closes #25

    O-x86 O-arm 
    opened by taiki-e 7
  • Add add/sub/and/or/xor methods that do not return previous value

    Add add/sub/and/or/xor methods that do not return previous value

    This adds Atomic{I,U}*::{add,sub,and,or,xor} and AtomicBool::{and,or,xor} methods.

    They are equivalent to the corresponding fetch_* methods, but do not return the previous value. They are intended for optimization on platforms that implement atomics using inline assembly, such as the MSP430.

    Currently, optimizations by these methods (add,sub,and,or,xor) are only guaranteed for MSP430; on x86, LLVM can optimize in most cases, so cases, where this would improve things, should be rare.

    See https://github.com/pftbest/msp430-atomic/issues/7 for the context. cc @cr1901 @YuhanLiin

    O-msp430 
    opened by taiki-e 7
  • Add a reference counted container

    Add a reference counted container

    This pull requests resolves #37 by adding Arc and Weak types to the portable-atomic-util crate that use portable_atomic::AtomicUsize in their operation. The goal is to allow for portable using of Arc on platforms that may have allocation but not atomics. Arduino AVR comes to mind for this.

    These new types are based off of the ones in libstd, but I explicitly avoid using unstable features. I do not implement unstable functions, like new_uninit. I also avoided certain functions like new_cyclic and take_mut because I didn't get around to it.

    opened by notgull 6
  • Optimize `AtomicU128::{load, store}`

    Optimize `AtomicU128::{load, store}`

    Processors that enumerate support for Intelยฎ AVX (by setting the feature flag CPUID.01H:ECX.AVX[bit 28]) guarantee that the 16-byte memory operations performed by the following instructions will always be carried out atomically:

    • MOVAPD, MOVAPS, and MOVDQA.
    • VMOVAPD, VMOVAPS, and VMOVDQA when encoded with VEX.128.
    • VMOVAPD, VMOVAPS, VMOVDQA32, and VMOVDQA64 when encoded with EVEX.128 and k0 (masking disabled).

    (Note that these instructions require the linear addresses of their memory operands to be 16-byte aligned.)

    AtomicU128::{load, store} can take advantage of this instead of using the more expensive cmpxchg instruction. See this GCC issue/patch for details: https://gcc.gnu.org/bugzilla//show_bug.cgi?id=104688.

    C-enhancement O-x86 O-arm 
    opened by ibraheemdev 5
  • Add fetch_neg/neg/fetch_not/not

    Add fetch_neg/neg/fetch_not/not

    Part of #48

    • Add AtomicI*::{fetch_neg,neg} and AtomicF*::fetch_neg methods.

      AtomicI*::neg are equivalent to the corresponding fetch_* methods, but do not return the previous value. They are intended for optimization on platforms that have atomic instructions for the corresponding operation, such as x86's lock neg.

      Currently, optimizations by these methods (neg) are only guaranteed for x86.

    • Add Atomic{I,U}*::{fetch_not,not} methods.

      Atomic{I,U}*::not are equivalent to the corresponding fetch_* methods, but do not return the previous value. They are intended for optimization on platforms that have atomic instructions for the corresponding operation, such as x86's lock not, MSP430's inv.

      Currently, optimizations by these methods (not) are only guaranteed for x86 and MSP430.

      (Note: AtomicBool already has fetch_not and not methods.)

    O-x86 O-msp430 
    opened by taiki-e 4
  • Fix `-Z allow-features` check

    Fix `-Z allow-features` check

    If it is specified multiple times, the last value will be preferred.

    // build.rs
    use std::env;
    fn main() {
        println!("cargo:rerun-if-env-changed=PREFER_FIRST");
        if env::var_os("PREFER_FIRST").is_some() {
            if is_allowed_feature1("core_intrinsics") {
                println!("cargo:rustc-cfg=core_intrinsics");
            }
            if is_allowed_feature1("asm_const") {
                println!("cargo:rustc-cfg=asm_const");
            }
        } else {
            if is_allowed_feature2("core_intrinsics") {
                println!("cargo:rustc-cfg=core_intrinsics");
            }
            if is_allowed_feature2("asm_const") {
                println!("cargo:rustc-cfg=asm_const");
            }
        }
    }
    fn is_allowed_feature1(name: &str) -> bool {
        if let Some(rustflags) = env::var_os("CARGO_ENCODED_RUSTFLAGS") {
            for mut flag in rustflags.to_string_lossy().split('\x1f') {
                flag = flag.strip_prefix("-Z").unwrap_or(flag);
                if let Some(flag) = flag.strip_prefix("allow-features=") {
                    return flag.split(',').any(|allowed| allowed == name);
                }
            }
        }
        // allowed by default
        true
    }
    fn is_allowed_feature2(name: &str) -> bool {
        // allowed by default
        let mut allowed = true;
        if let Some(rustflags) = env::var_os("CARGO_ENCODED_RUSTFLAGS") {
            for mut flag in rustflags.to_string_lossy().split('\x1f') {
                flag = flag.strip_prefix("-Z").unwrap_or(flag);
                if let Some(flag) = flag.strip_prefix("allow-features=") {
                    // If it is specified multiple times, the previous value will be overwritten.
                    allowed = flag.split(',').any(|allowed| allowed == name);
                }
            }
        }
        allowed
    }
    
    // lib.rs
    #![cfg_attr(core_intrinsics, feature(core_intrinsics))]
    #![cfg_attr(asm_const, feature(asm_const))]
    
    $ PREFER_FIRST=1 RUSTFLAGS='-Z allow-features=asm_const -Z allow-features=core_intrinsics' cargo build
    error[E0725]: the feature `asm_const` is not in the list of allowed features
     --> src/lib.rs:2:32
      |
    2 | #![cfg_attr(asm_const, feature(asm_const))]
      |                                ^^^^^^^^^
    $ RUSTFLAGS='-Z allow-features=asm_const -Z allow-features=core_intrinsics' cargo build
        Finished dev [unoptimized + debuginfo] target(s) in 0.12s
    

    (The first commit is from #52.)

    opened by taiki-e 4
  • x86_64: Add portable_atomic_vmovdqa_atomic cfg

    x86_64: Add portable_atomic_vmovdqa_atomic cfg

    Replaces #21.

    As said in https://github.com/taiki-e/portable-atomic/pull/21#issuecomment-1345486320, adopt the approach using cfg.

    cc https://github.com/taiki-e/portable-atomic/issues/10

    O-x86 
    opened by taiki-e 0
  • Reduce CI time

    Reduce CI time

    The slowest job in our CI (build (nightly)) takes over an hour. This is a really annoying situation, so let's investigate if we can shorten the time.

    ci1 ci2 ci3
    opened by taiki-e 3
  • WIP: add feature to use critical-section.

    WIP: add feature to use critical-section.

    I want to depreecate atomic-polyfill in favor of portable-atomic. This is the only thing left that portable-atomic can't do, so here it goes.

    PR is still missing updating docs. I'll do it if you confirm you're onboard with the idea of supporting using critical-section.

    opened by Dirbaio 11
  • Provide more atomic ops

    Provide more atomic ops

    The following are the atomic operations supported by the x86 lock prefix.

    ADD, ADC, AND, BTC, BTR, BTS, CMPXCHG, CMPXCH8B, CMPXCHG16B, DEC, INC, NEG, NOT, OR, SBB, SUB, XOR, XADD, and XCHG.

    We currently do not provide corresponding operations for BTC, BTR, BTS, NEG, and NOT. (To be exact, BTC, BTR, and BTS are available via other operations on Rust 1.65+, but it would probably make sense to have dedicated methods like Zig)

    I don't think NEG and NOT return the previous value, but can be provided in a way like #47.

    • [ ] BTS (fetch_bit_set?)
    • [ ] BTR (fetch_bit_reset or fetch_bit_clear?)
    • [ ] BTC (fetch_bit_toggle?)
    • [x] NEG (fetch_neg, neg); done in https://github.com/taiki-e/portable-atomic/pull/54
    • [x] NOT (fetch_not, not); done in https://github.com/taiki-e/portable-atomic/pull/54
    C-enhancement 
    opened by taiki-e 0
  • Tracking issue: initial portable-atomic-util release

    Tracking issue: initial portable-atomic-util release

    I would like to create the initial release of portable-atomic-util as #41 merged.

    This tracks the TODOs required for the release.

    Open questions

    • [ ] Should the version be the same version as the main portable-atomic crate?
      • I feel that it should not be; when portable-atomic is released as 1.0, I would not expect portable-atomic-util to be stable enough to be 1.0.

    TODOs

    • [ ] Update release workflow for portable-atomic-util
    opened by taiki-e 0
Releases(v0.3.19)
  • v0.3.19(Dec 25, 2022)

    • Add AtomicI*::{fetch_neg,neg} and AtomicF*::fetch_neg methods. (#54)

      AtomicI*::neg are equivalent to the corresponding fetch_* methods, but do not return the previous value. They are intended for optimization on platforms that have atomic instructions for the corresponding operation, such as x86's lock neg.

      Currently, optimizations by these methods (neg) are only guaranteed for x86.

    • Add Atomic{I,U}*::{fetch_not,not} methods. (#54)

      Atomic{I,U}*::not are equivalent to the corresponding fetch_* methods, but do not return the previous value. They are intended for optimization on platforms that have atomic instructions for the corresponding operation, such as x86's lock not, MSP430's inv.

      Currently, optimizations by these methods (not) are only guaranteed for x86 and MSP430.

      (Note: AtomicBool already has fetch_not and not methods.)

    • Enable outline-atomics for 128-bit atomics by default. (#57) See #57 for more.

    • Improve support for old nightly compilers.

    Source code(tar.gz)
    Source code(zip)
  • v0.3.18(Dec 15, 2022)

    • Fix build error when not using portable_atomic_unsafe_assume_single_core cfg on AVR and MSP430 custom targets. (#50)

      Since 0.3.11, atomic CAS was supported without the cfg on AVR and MSP430 builtin targets, but that change was not applied to custom targets.

    Source code(tar.gz)
    Source code(zip)
  • v0.3.17(Dec 14, 2022)

  • v0.3.16(Dec 9, 2022)

    • Add Atomic{I,U}*::{add,sub,and,or,xor} and AtomicBool::{and,or,xor} methods. (#47)

      They are equivalent to the corresponding fetch_* methods, but do not return the previous value. They are intended for optimization on platforms that implement atomics using inline assembly, such as the MSP430.

    • Various improvements to portable_atomic_unsafe_assume_single_core cfg. (#44, #40)

      • Support disabling FIQs on pre-v6 ARM under portable_atomic_disable_fiq cfg.
      • Support RISC-V supervisor mode under portable_atomic_s_mode cfg.
      • Optimize interrupt restore on AVR and MSP430. (#40)
      • Documentation improvements.

      See #44 for more.

    Source code(tar.gz)
    Source code(zip)
  • v0.3.15(Sep 9, 2022)

  • v0.3.14(Sep 4, 2022)

    • Optimize atomic load/store on no-std pre-v6 ARM when portable_atomic_unsafe_assume_single_core cfg is used. (#36)

    • Support pre-power8 powerpc64le. powerpc64le's default cpu version is power8, but you can technically compile it for the old cpu using the unsafe -C target-cpu rustc flag.

    Source code(tar.gz)
    Source code(zip)
  • v0.3.13(Aug 15, 2022)

    • Use track_caller when debug assertions are enabled on Rust 1.46+.

    • Make powerpc64 128-bit atomics compatible with Miri and ThreadSanitizer on LLVM 15+.

    • Document that 128-bit atomics are compatible with Miri and ThreadSanitizer on recent nightly.

    Source code(tar.gz)
    Source code(zip)
  • v0.3.12(Aug 13, 2022)

  • v0.3.11(Aug 12, 2022)

    • Always provide atomic CAS for MSP430 and AVR. (#31)

      This previously required unsafe cfg portable_atomic_unsafe_assume_single_core, but since all MSP430 and AVR are single-core, we can safely provide atomic CAS based on disabling interrupts.

    • Support fence and compiler_fence on MSP430. (On MSP430, the standard library's fences are currently unavailable due to LLVM errors.)

    • Update safety requirements for unsafe cfg portable_atomic_unsafe_assume_single_core to mention use of privileged instructions to disable interrupts.

    • Atomic operations based on disabling interrupts on single-core systems are now considered lock-free.

      The previous behavior was inconsistent because we consider the pre-v6 ARM Linux's atomic operations provided in a similar way by the Linux kernel to be lock-free.

    • Respect -Zallow-features.

    Source code(tar.gz)
    Source code(zip)
  • v0.3.10(Aug 3, 2022)

  • v0.3.9(Aug 3, 2022)

  • v0.3.8(Aug 2, 2022)

  • v0.3.7(Jul 31, 2022)

    • Provide stable equivalent of #![feature(strict_provenance_atomic_ptr)]. (#23)

      • AtomicPtr::fetch_ptr_{add,sub}
      • AtomicPtr::fetch_byte_{add,sub}
      • AtomicPtr::fetch_{or,and,xor}

      These APIs are compatible with strict-provenance on cfg(miri). Otherwise, they are compatible with permissive-provenance. Once #![feature(strict_provenance_atomic_ptr)] is stabilized, these APIs will be strict-provenance compatible in all cases from the version in which it is stabilized.

    • Provide stable equivalent of #![feature(atomic_bool_fetch_not)]. (#24)

      • AtomicBool::fetch_not
    • Optimize x86_64 128-bit RMWs. (#22)

    • Optimize x86_64 outline-atomics.

    • Optimize inline assemblies on ARM and AArch64.

    • Revert thumbv6m atomic load/store changes made in 0.3.5. This is because rust-lang/rust#99595 has been reverted, so this is no longer needed.

    Source code(tar.gz)
    Source code(zip)
  • v0.3.6(Jul 26, 2022)

    • Fix build failure due to the existence of the specs directory.
    • Documentation improvements.
    • Optimize inline assemblies on x86_64, riscv, and msp430.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.5(Jul 23, 2022)

  • v0.3.4(Jun 25, 2022)

  • v0.3.3(Jun 24, 2022)

  • v0.3.2(Jun 19, 2022)

    • Optimize x86_64 128-bit atomic load/store on Intel CPU with AVX. (#16)

    • Support native 128-bit atomic operations for powerpc64 (le or pwr8+, currently nightly-only).

    • Fix behavior differences between stable and nightly. (#15)

    Source code(tar.gz)
    Source code(zip)
  • v0.3.1(Jun 16, 2022)

  • v0.3.0(Mar 25, 2022)

    • Support native 128-bit atomic operations for s390x (currently nightly-only).

    • Add AtomicF{32,64}::fetch_abs.

    • Add #[must_use] to constructors.

    • Use 128-bit atomic operation mappings same as LLVM, on aarch64.

    • Remove parking_lot optional feature to allow the use of this crate within global allocators.

    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Mar 17, 2022)

  • v0.2.0(Mar 10, 2022)

    • Remove i128 feature. Atomic{I,U}128 are now always enabled.

    • Add outline-atomics feature. Currently, this is the same as the 0.1's i128-dynamic, except that fallback feature is not implicitly enabled.

    • Remove i128-dynamic feature in favor of outline-atomics feature.

    • Add AtomicF{32,64}::as_bits.

    Source code(tar.gz)
    Source code(zip)
  • v0.1.4(Mar 2, 2022)

  • v0.1.3(Feb 28, 2022)

  • v0.1.2(Feb 26, 2022)

  • v0.1.1(Feb 25, 2022)

  • v0.1.0(Feb 24, 2022)

Serialize/DeSerialize for Rust built-in types and user defined types (complex struct types)

Serialize/DeSerialize for Rust built-in types and user defined types (complex struct types)

null 2 May 3, 2022
Allows conversion between ndarray's types and image's types

ndarray-image Allows conversion between ndarray's types and image's types Deprecated WARNING: This crate is currently deprecated in favor of https://g

Rust Computer Vision 11 Jul 26, 2022
Atomic Physics Library

Iridium Atomic Physics Library Attempt at making a atomic database. Uses Nubase2020, ENSDF for decay chains, atomic masses, and half-lives. Nubase2020

J.A Sory 14 Jun 19, 2022
Arduino Nano frequency counter with atomic clock accuracy

Arduino Nano frequency counter with atomic clock accuracy Project description and test setup With this project you can measure a frequency from less t

Frank Buss 24 Apr 3, 2022
Create, share, fetch and model Atomic Data! This project consists of a graph database + server, a CLI and a rust library.

Create, share, fetch and model Atomic Data! This repo consists of three components: A library, a server and a CLI. atomic-server Status: Beta. Breakin

Joep Meindertsma 195 Dec 28, 2022
Quinine is a Rust library that implements atomic, lock-free, but write-once versions of containers like `Box` or `Arc`

Quinine is a Rust library that implements atomic, lock-free, but write-once versions of containers like `Box` or `Arc`

Paul Khuong 4 Feb 19, 2022
An attempt to implement equivalent of C++ "P1478R1: Byte-wise atomic memcpy" in Rust

atomic-memcpy Byte-wise atomic memcpy. This is an attempt to implement equivalent of C++ "P1478R1: Byte-wise atomic memcpy" in Rust. This is expected

Taiki Endo 12 Dec 1, 2022
Atomic `dbg`/`eprintln`/`eprint` macros

atomic-dbg This crate provides dbg, eprint, and eprintln, macros which work just like their counterparts in std, but which: Write atomically, up to th

Dan Gohman 14 May 10, 2022
Log for concurrent workloads, with support for atomic batches and in-order recovery

sharded-log A batch-oriented multi-threaded sharded log for workloads that occasionally flush logs into some other system. All batches have a 32-bit C

Komora 16 Nov 20, 2022
A lock-free, append-only atomic pool.

A lock-free, append-only atomic pool. This library implements an atomic, append-only collection of items, where individual items can be acquired and r

Jon Gjengset 64 Oct 24, 2022
Moonshine CSS - ๐Ÿฅƒ High-proof atomic CSS framework

Moonshine CSS - ?? High-proof atomic CSS framework

Econify 25 Nov 25, 2022
Cross-platform atomic wait and wake (aka futex) functionality for Rust.

Cross platform atomic wait and wake (aka futex) functionality. This crate only supports functionality that's available on all of Linux, Windows, and m

Mara Bos 38 Dec 15, 2022
An intent-centric, privacy-preserving protocol for decentralized counterparty discovery, solving, and multi-chain atomic settlement.

Anoma Blockchain prototye This prototype aims to reproduce the following topology: โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚Sol

anoma 5 Dec 15, 2022
An atomic save/load system for Bevy Game Engine.

โ˜ข๏ธ Bevy Atomic Save An atomic save/load system for Bevy. Features Save and load a World into a RON file on disk Control which entities should particip

null 11 Jan 28, 2023
Linked Atomic Random Insert Vector: a thread-safe, self-memory-managed vector with no guaranteed sequential insert.

Linked Atomic Random Insert Vector Lariv is a thread-safe, self-memory-managed vector with no guaranteed sequential insert. It internally uses a linke

Guillem Jara 8 Feb 1, 2023
Mirroring remote repositories to s3 storage, with atomic updates and periodic garbage collection.

rsync-sjtug WIP: This project is still under development, and is not ready for production use. rsync-sjtug is an open-source project designed to provi

SJTUG 57 Feb 22, 2023
Thread-safe cell based on atomic pointers to externally stored data

Simple thread-safe cell PtrCell is an atomic cell type that allows safe, concurrent access to shared data. No std, no data races, no nasal demons (UB)

Nikolay Levkovsky 3 Mar 23, 2024
Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.

libui: a portable GUI library for C This README is being written. Status It has come to my attention that I have not been particularly clear about how

Pietro Gagliardi 10.4k Dec 31, 2022
The feature-rich, portable async channel library

The feature-rich, portable async channel library > crates.io > docs.rs Why use Postage? Includes a rich set of channels. | barrier | broadcast | dispa

Austin Jones 221 Dec 26, 2022
A modern, portable, easy to use crypto library.

Sodium is a new, easy-to-use software library for encryption, decryption, signatures, password hashing and more. It is a portable, cross-compilable, i

Frank Denis 10.7k Jan 3, 2023