Today we are going to see how processes can communicate using shared memory
Links:
GitHub Invitation URL: exercise19
Steps:
shared_ring_buffer.h
and shared_ring_buffer.tpp
implement a shared deque between threads.qt_shared_deque_1.cpp
a simple process that dequeues from the bufferqt_shared_deque_2.cpp
a simple process that enqueues a constant to the bufferBuild and run the applications in separate shells. Verify they communicate properly.
Modify qt_shared_deque_2.cpp
so that it prompts the user via standard input for an integer to enqueue as long as there is space in the buffer.
Recompile your applications. Start qt_shared_deque_2
first and enter in several numbers at the prompt. Then in a separate shell start qt_shared_deque_1
. What happens?
Now, use git to commit the source files changed to the local repository.
Finally, use git push to synchronize the repository with that on GitHub.
You have completed the Exercise.