Mind Mixer
Mind Mixer

Reputation: 1583

wxPython internals: two created threads after calling app.MainLoop()

My question is about wxPython internals. When I run some simple and trivial application which contains wxPython code:

app = wx.App(False)
frame = MainWindow(None, "Window")
app.MainLoop()

As a result I have the 3 threads (before execution of this code I had 1 thread which called MainThread, it's obvious). I saw it using the following command:

$ ls /proc/<number of process>/tasks

Using logging module I've determined that all what I do in MainWindow executed in MainThread thread. What do those 2 threads. I have some guesses, but want to read the expert's answers. I know that I can see the source code but maybe I can read some articles about my question.

Upvotes: 1

Views: 67

Answers (1)

RobinDunn
RobinDunn

Reputation: 6206

I don't know the specifics in this case but wxWidgets will sometimes use threads to help it do things such as receiving certain types of out-of-band notifications, general housekeeping, etc. Additionally, in some cases the native toolkit that wxWidgets is built upon will use threads itself for similar types of things. In general you can ignore those threads, thinking of them as "implementation details" and just deal with the main thread.

Upvotes: 2

Related Questions