Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
/ zig-xbeam Public archive

A very partial re-implementation of the rust crate crossbeam.

License

Notifications You must be signed in to change notification settings

leecannon/zig-xbeam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zig-xbream

This repo is a very partial (pull requests welcome) re-implementation of the rust crate crossbeam.

Only the following types are implemented:

Data structures

  • xbeam.queue.ArrayQueue - a bounded MPMC queue that allocates a fixed-capacity buffer on construction.
  • xbeam.queue.ArrayQueueNoAlloc - an implementation of ArrayQueue that does not allocate.

Utilities

  • xbeam.utils.Backoff - for exponential backoff in spin loops.

  • xbeam.utils.CACHE_LINE_LENGTH - replacement for the rust CachePadded, used like this:

    var aligned: usize align(xbeam.utils.CACHE_LINE_LENGTH) = 0;

Contributions are welcome!

How to use

Download the repo somehow then either:

Use a package manager

Add as package in build.zig

  • To build.zig add:

    exe.addPackagePath("xbeam", "zig-xbeam/src/index.zig"); // or whatever the path is
  • Then the package is available within any zig file:

    const xbeam = @import("xbeam");

Import directly

In any zig file add:

const xbeam = @import("../zig-xbeam/src/index.zig"); // or whatever the path is from *that* file

About

A very partial re-implementation of the rust crate crossbeam.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published