This is an interactive app of moving a point in a display, using a thread-safe queue. The queue is implemented in the pthread library.
Tested on Ubuntu 20.04 LTS.
- Ubuntu 20.04 LTS (other distro probably also works)
- gcc
- pthread
cd ~
git clone https://github.com/maronuu/ThreadSafeQueue.git
cd ~/ThreadSafeQueue
make
cd ~/ThreadSafeQueue/build
./main
The point @ will move to the destination.
You don't have to wait until it stops! Your input is to be pushed into a thread-safe queue, which can store and provide designated points to threads safely.
cd ~/ThreadSafeQueue/build
./queueTest
The output will be
Start Testing...
Success!

