GithubHelp home page GithubHelp logo

krh1502 / down-with-locks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gparmer/down-with-locks

0.0 0.0 0.0 475 KB

Viva la revolucion! Down with locks!

License: BSD 2-Clause "Simplified" License

C 87.18% Makefile 12.82%

down-with-locks's Introduction

Down with locks!

Viva la revolucion! Down with locks!

Let us band together, and cask off our tyrranical lock-based bonds (shown here) of mutually exclusive oppression!

Ne'er shall we be forced to serialize in a critical section again!

We need doors without locks; we need windows without locks; band together with me revolutionaries, we need stacks without locks! Let us not be afraid of the race conditions, and instead embrace the race conditions! Open access for all; let the cleansing light of complete transparency and arbitrary interleavings wash over your data-structures!

The call to action

Inspired by the lockless luminary, Robert Frost, and our shadowy leader, the Loch-less Monster, we will draw all our attention to data-structures with no lock to lock.

It went many years,

But at last came a knock,

And I thought of the door

With no lock to lock.

...

-The Lockless Door, Robert Frost

Find our lock-free stack comrade, main.c. They exist as the founders imagined it, blissfully existing in freedom with unregulated access to all!

  • First, let us understand the power that comes with freedom. Execute bin and taste the freedom. By default our revolution is focused on BURN_IT_DOWN! (See the #defines at the top of main.c.) What is the problem with this phase of the revolution? Necessary radical reforms always face head-winds! But we have to identify where the problem is so that we can come up with a plan.
  • Second, lets add some order to the chaos. Now, WE_HAVE_A_PLAN. But our plan is not, well, good. Why is it not good?
  • As it turns out, organizing bytes is hard. Lets let the PROFESSIONALS_TAKE_OVER. What is this code doing? What is the principle that it is imposing? Why does it add more order to the system?

PSSSSSST!

Come check out the counter revolution in ticket.c. We're formenting distrust in the anarchy of arbitrary interleaving by using the power of counting to maintain orderly mutual exclusion with bounded wait. However, even the counter-revolution cannot be perfect, and after the drastic fall of the lock-free revolution due to the ABA uprising, we must be more self-critical.

  • How does this lock guarantee bounded wait?
  • What are the downsides of ticket locks over a lock (using cas or t&s which we saw in lecture) that don't provide bounded wait?

down-with-locks's People

Contributors

gparmer 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.