Code examples, data structures, and links from my book, Rust Atomics and Locks.

Overview

This repository contains the code examples, data structures, and links from Rust Atomics and Locks.

The examples from chapters 1, 2, 3, and 8 can be found in examples/. The data structures from chapters 4, 5, 6, and 9 can be found in src/.

Chapter 1 — Basics of Rust Concurrency

Chapter 2 — Atomics

Chapter 3 — Memory Ordering

Chapter 4 — Building Our Own Spin Lock

Chapter 5 — Building Our Own Channels

Chapter 6 — Building Our Own “Arc”

Chapter 7 — Understanding the Processor

Chapter 8 — Operating System Primitives

Chapter 9 — Building Our Own Locks

Chapter 10 — Ideas and Inspiration

License

You may use all code in this repository for any purpose.

Attribution is appreciated, but not required. An attrubution usually includes the book title, author, publisher, and ISBN. For example: "Rust Atomics and Locks by Mara Bos (O’Reilly). Copyright 2023 Mara Bos, 978-1-098-11944-7."

You might also like...
A real-time event-oriented data-hub

Redcar A real-time event-oriented data-hub, inspired by the data hub. It is: Universal: the front end uses gRPC to provide services. Fast: benchmarked

Parses COVID-19 testing data from DC government ArcGIS APIs

covid-dc Parses COVID-19 testing data from DC government ArcGIS APIs Example debug output from cargo run RapidSite { attributes: RapidSiteAttribut

Disaggregate zone-based origin/destination data to specific points
Disaggregate zone-based origin/destination data to specific points

odjitter This crate contains an implementation of the ‘jittering’ technique for pre-processing origin-destination (OD) data. Jittering in a data visua

Stdto provides a set of functional traits for conversion between various data representations.

Stdto stdto provides a set of functional traits for conversion between various data representations. | Examples | Docs | Latest Note | stdto = "0.13.0

Transfer data with the LCU in the command-line interface! 🖥
Transfer data with the LCU in the command-line interface! 🖥

llux llux (short for LCU Lux) is an open-source CLI tool to easily transfer data with the LCU without any script or code setup, hehe! Preview Download

Experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code

Diplomat is an experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code. With Diplomat, you can simply define Rust APIs to be exposed over FFI and get high-level C, C++, and JavaScript bindings automatically!

Generate bindings to use Rust code in Qt and QML
Generate bindings to use Rust code in Qt and QML

Rust Qt Binding Generator This code generator gets you started quickly to use Rust code from Qt and QML. In other words, it helps to create a Qt based

Rust library to scan files and expand multi-file crates source code as a single tree

syn-file-expand This library allows you to load full source code of multi-file crates into a single syn::File. Features: Based on syn crate. Handling

A code generator to reduce repetitive tasks and build high-quality Rust libraries. 🦀

LibMake A code generator to reduce repetitive tasks and build high-quality Rust libraries Welcome to libmake 👋 Website • Documentation • Report Bug •

Comments
  • Clarification needed for order in the same thread.

    Clarification needed for order in the same thread.

    First of all, Thanks for the great book. Secondly, if this is not the right place to talk about the book, let me know.

    From the Chapter 3:

    2023-01-06 at 1 29 PM

    AFAIK, compiler reorder, runtime instruction reorder and store buffer can all change the order of the of the execution. Not sure how to digest the statement in the picture above, and it's so hard to reason about the 0 20 example by following it ↑.

    opened by Daniel-Xu 0
Owner
Mara Bos
she/her
Mara Bos
Rust examples for stm32-cam

esp32cam-rs Rust esp32-cam examples Usage populate the required .txt files, then run the examples ./examples/telegram_bot/bot_token.txt ./examples/tel

Kezi 4 Feb 17, 2024
Examples to demonstrate how to use PipeCD

examples A repository contains some examples for PipeCD. NOTE: This repository is automatically synced from the examples directory of pipe-cd/pipe rep

PipeCD 20 Dec 14, 2022
CPI examples for deposits/withdrawals with Friktion Volts

Lightning Overview CPI Examples for interacting with Friktion's volt program Devnet Faucets Can be found here: https://app.friktion.fi/faucet Docs Ful

Friktion Labs 2 Jul 22, 2022
Code for connecting an RP2040 to a Bosch BNO055 IMU and having the realtime orientation data be sent to the host machine via serial USB

Code for connecting an RP2040 (via Raspberry Pi Pico) to a Bosch BNO055 IMU (via an Adafruit breakout board) and having the realtime orientation data be sent to the host machine via serial USB.

Gerald Nash 3 Nov 4, 2022
Doku is a framework for building documentation with code-as-data methodology in mind.

Doku is a framework for building documentation with code-as-data methodology in mind. Say goodbye to stale, hand-written documentation - with D

ANIXE 73 Nov 28, 2022
Utilities to gather data out of roms. Written in Rust. It (should) support all types.

snesutilities Utilities to gather data out of roms. Written in Rust. It (should) support all types. How Have a look at main.rs: use snesutilities::Sne

Layle | Luca 5 Oct 12, 2022
Rust libraries for working with GPT (GUID Partition Table) disk data

gpt-disk-rs no_std libraries related to GPT (GUID Partition Table) disk data. There are three Rust packages in this repository: uguid The uguid packag

Google 25 Dec 24, 2022
A naive buffered/sync channel implementation in Rust, using the queue data structure

buffered-queue-rs Introduction This is my attempt at a simple and very naive buffered/synced queue implementation in Rust. The base thread-safe queue

Dhruv 4 Jul 22, 2023
Experimental playground for wiktionary data

wikt Experimental playground for wiktionary data. This document might not update as often as the code does. Set up You'll want a minimum of 10 GB free

Félix Saparelli 8 Jul 9, 2022
A VtubeStudio plugin that allows iFacialMocap to stream data to the app, enabling full apple ARkit facial tracking to be used for 2D Vtuber models.

facelink_rs A VtubeStudio plugin that allows iFacialMocap to stream data to the app, enabling full apple ARkit facial tracking to be used for 2D Vtube

Slashscreen 2 May 6, 2022