GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - spurnaye/LocklessQueue: A lockless, multi-producer, multi-consumer Queue written in C++

BranchesTags
Open more actions menu

Latest commit

 

History

10 Commits
10 Commits

Folders and files

NameName
Last commit message
Last commit date
LocklessQueue_files
LocklessQueue_files
 
 
LocklessQueue.cpp
LocklessQueue.cpp
 
 
LocklessQueue.hpp
LocklessQueue.hpp
 
 
LocklessQueue.ipynb
LocklessQueue.ipynb
 
 
LocklessQueue.md
LocklessQueue.md
 
 
LocklessSemaphore.cpp
LocklessSemaphore.cpp
 
 
LocklessSemaphore.hpp
LocklessSemaphore.hpp
 
 
Makefile
Makefile
 
 
Queue.hpp
Queue.hpp
 
 
README.md
README.md
 
 
RegularQueue.cpp
RegularQueue.cpp
 
 
RegularQueue.hpp
RegularQueue.hpp
 
 
Semaphore.cpp
Semaphore.cpp
 
 
Semaphore.hpp
Semaphore.hpp
 
 
ShutdownException.hpp
ShutdownException.hpp
 
 
main_test.cpp
main_test.cpp
 
 
ten_million-four_threads.csv
ten_million-four_threads.csv
 
 
ten_million-six_threads.csv
ten_million-six_threads.csv
 
 
ten_million-two_threads.csv
ten_million-two_threads.csv
 
 
verify.sh
verify.sh
 
 

Repository files navigation

LocklessQueue

A lockless, multi-producer, multi-consumer, expandable queue written in C++

Mutexes are slow. Lockless data structures are fast. Here's a fairly quick 'lockless' queue that can have as many threads enqueueing and dequeueing as you want, and can grow as needed.

It only locks when necessary (trying to dequeue on an empty queue, trying to enqueue a full queue)

Check out the benchmarks to see the comparison with a fairly standard multithreaded queue implementation. In the cases presented it's about twice as fast, (although the advantage seems to diminish as contention increases) The code used to test is also presented (the version for 2 producers, 2 consumers is what's checked in. Only add or remove threads and parameters to verify_x to change it. Change COUNT to alter the number of integers enqueued per producer.)

And check out main_test.cpp to see the queue in action.

About

A lockless, multi-producer, multi-consumer Queue written in C++

Resources

Readme
Activity

Stars

1 star

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.