GithubHelp home page GithubHelp logo

emaxerrno / asm_concurrency Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davidad/asm_concurrency

0.0 1.0 0.0 172 KB

A demo of concurrency primitives in x64 assembly

Makefile 9.24% Assembly 90.76%

asm_concurrency's Introduction

asm_concurrency

How to run:

  • Make sure you have a recent nasm; check that nasm -v reports 2.11 or newer.
$ git clone https://github.com/davidad/asm_concurrency.git
$ cd asm_concurrency
$ make
  • See results.
  • If you want to verify deterministic behavior, run make integrity_check.

You can also supply a command-line argument, which will be opened as a binary file.

$ make concurrency-noprint-x3 concurrency-noprint-x4
$ ./concurrency-noprint-x4 foo
$ ./concurrency-noprint-x3 bar
$ diff foo bar
$ # same results, yay!

The number after the x indicates how many processes will be forked by that executable. You can even run more than one instance of "concurrency" concurrently (shocking!).

$ make clean
$ make size=10000000 concurrency-noprint-x3
$ ./concurrency-noprint-x3 quux &            # this will take a little while
$ ./concurrency-noprint-x3 quux
$ ./concurrency-noprint-x3 quuux &
$ ./concurrency-noprint-x3 quuux &
$ ./concurrency-noprint-x3 quuux
$ diff quux quuux
$ # hoo-ah!

make options you can tweak (with their default values):

$ make size=1000000 "nprocs=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
  • The output file will have size (size+1)*8. (This is due to keeping a bookkeeping quad-word in the file and assuming for simplicity that the file is an integer number of quad-words.)
  • nprocs specifies the set of executables to build and test (-x1, -x2, etc.). This should have just been a command-line argument, but eh, this way works.

asm_concurrency's People

Contributors

davidad avatar

Watchers

Alexander Gallego 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.