A basic multithreading example, and the result of running the program is shown in the following link and the figure.
https://github.com/yan9a/cewx/blob/master/thread/thread1/thread1.cpp
Simple Multithreading Example
As a simple multithreading example, the program at the following link is discussed.https://github.com/yan9a/cewx/blob/master/thread/th-simple/th-simple.cpp
Firstly, start, stop, pause, and resume buttons are added. Start button is used to create and start a new thread. Clicking the 'Stop' button looks for the last created thread and delete it. Pause button is used to pause the last started thread. Resume button is used to look for the last paused thread and run it.