A solution of the well-known producer-consumer problem using principles of concurrency control and to distribute tasks between threads so they can be processed concurrently keeping critical section in mind.
Report Bug
·
Request Feature
This project is all about building a multithreaded application to devise a means to distribute tasks between threads so they can be processed concurrently.
Queues are good devices for transferring work items from one thread to another. In this repository I’ll discuss the design of a work queue class implemented in C++ that can be used with Threads class objects to easily build a multithreaded application.
- Get the source code of Threads, which is a java like implementation of posix threads encapsulated cleanly in a single C++ class i.e. clone both this repository as well as above repository in the same folder using
git clone https://github.com/shie-ld/threads.git
git clone https://github.com/shie-ld/work-queue.git
cd
to thethreads
directory.- Type
make
to build thethreads
program. cd ..
to jump back to previous directory.cd
to thework-queue
directory.- Type
make
to build thework-queue
program. - Run the test application as
./wqueue
.
- A C++ compiler, like
g++
orcc
orclang
. make
utility.
Both of them mostly come preinstalled in a typical linux distribution like Ubuntu.
See the docs.
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Project Link: https://github.com/shie-ld/work-queue