Skip to content

rotaki/mcs_lock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCSLock implementation

MCSLock is a queue based lock implementation. This implementation is based on the following materials.

Build

g++ main.cpp mcs_lock.cpp -lpthread -Ofast

Performance

Benchmarking is done by incrementing a shared counter using 8 core Intel(R) Core(TM) i9-9900 CPU @ 3.10GHz with 32GB RAM, 2 threads per core.

$ g++ --version
g++ (Ubuntu 11.1.0-1ubuntu1~20.04) 11.1.0

std::mutex seems to win most of the time except for single threaded execution.

1 Thread 2 Threads 8 Threads 16 Threads

The graph can be obtained by executing run_experiment.py.

About

mcs_lock implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published