Showing posts with label multithreading. Show all posts
Showing posts with label multithreading. Show all posts

Thursday, January 30, 2020

Multithreading with wxWidgets

In this article, the use of multithreading with wxWidgets is discussed using C++ example programs. The following usage examples are discussed and detailed explanations for each of the step and function of using multhreading are presented.


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




Figure 1. 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.