Skip to content

SergMir/edu-practice

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Races and Barriers

Initialization

  • An "auto-load safe-path" should be set in ~/.gdbinit, either / or a path to this directory:
echo "set auto-load safe-path /" >> ~/.gdbinit
  • Install libraries required for Qemu and Buildroot:
# Fedora
sudo dnf install \
  ncurses-devel perl-ExtUtils-MakeMaker ninja-build \
  glib2-devel pixman-devel libslirp-devel \
  perl-IPC-Cmd perl-open lz4 gawk make gcc \
  libmpc-devel gmp-devel

# Ubuntu
sudo apt install \
  libncurses-dev libextutils-makemaker-cpanfile-perl ninja-build \
  libglib2.0-dev libpixman-1-dev libslirp-dev
  libipc-run-perl lz4 gawk make gcc \
  libmpc-dev libgmp-dev
  • Build everything:
./init_build.sh

Running Optimization Demo

  • Start Qemu
./8_run.sh
  • Enter login root (without password)
  • Run the compiler barriers demo
/opt/compiler_opts
  • Run the CPU barriers demo
/opt/cpu_opts
  • Read and edit the code
$EDITOR demo_races/compiler_opts.c
$EDITOR demo_races/cpu_opts.c
  • Rebuild and re-run
./rebuild_rerun.sh
  • Exit Qemu with key combination Ctrl + A, X or poweroff

  • Run on a local machine:

% ./output/cpu_opts
without barriers: !A!B    942, !AB     24, A!B     33, AB      0
with barriers: !A!B      0, !AB      2, A!B      4, AB    993
%

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 67.6%
  • Shell 31.0%
  • GDB 1.4%