Is it possible to start a wxThread within an existing wxThread

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
robbiegregg
In need of some credit
In need of some credit
Posts: 9
Joined: Wed Mar 22, 2017 9:27 pm

Is it possible to start a wxThread within an existing wxThread

Post by robbiegregg »

Hi,

I would like to update an application of mine comprising a main GUI and a calculation wxThread which is run once the user clicks on a button to start the calculation.

Within this calculation, I have a function which take approximately 10 seconds to complete, and there are usually 10 executions required every time step. Currently these are run one after another.

I would like to have these function calls running in parallel by having multiple threads. My question is if I simply initiate multiple wxThreads from within my calculation wxThread, should this approach utilise the idle processors on my machine? I am finding the time per calculation is significantly more time than before.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Is it possible to start a wxThread within an existing wxThread

Post by doublemax »

I've never done this myself, but from everything i know it should be possible to create a thread from inside another worker thread.

I also didn't find anything in the documentation or the source code that tells otherwise.
Use the source, Luke!
Post Reply