Git Product home page Git Product logo

rlu-rust's Introduction

RLU in Rust

Overview

This is a userspace implementation of the Read-Log-Update concurrency mechanism (SOSP '15), written in Rust. This implementation is for the most part a direct port of the C code to Rust, with a few exceptions, and as a result uses lots of unsafe and raw pointer manipulations, and is not particularly "rusty".

Comparison to Original Implementation

One advantage of this implementation over the original C implementation is that it does not rely on any global state, so multiple RLU instances can exist simultaneously in a single process.

One disadvantage of this implementation vs. the original is that any data type wishing to use it must be placed in a wrapper struct that contains the RLU header and implements the RluObj trait. This requires some small overhead each time a new data type is used with the mechanism. The advantage of this approach is that it removes the need for custom allocation and freeing of headers placed in memory ahead of whatever data type is being used.

When evaluated using a linked-list based set, with workloads ranging from 2% writes to 40% writes and up to 8 simultaneous read/write threads, this implementation acheives on average 90% of the throughput of the original C implementation, and significantly outperforms lock based use of sets in the Rust standard library such as BTreeSet.

Other information

This project was implemented as a final project for Stanford's Programming Languages course (CS 242), taught by Will Crichton, and the benchmarking code and set testing code were written by him.

Disclaimer: It is very possible there exist race conditions or memory safety bugs in this code which my tests do not catch. As a result, it is definitely possible that functions not marked unsafe could actually lead to memory errors. This code should not be used in production under any assumption that it upholds all of Rust's guarantees with respect to memory safety / correctness.

rlu-rust's People

Contributors

hudson-ayers avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.