Simplest way to get wxWidgets to crash when using multiple threads

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
Blingo
Knows some wx things
Knows some wx things
Posts: 25
Joined: Tue Dec 17, 2013 3:39 pm

Simplest way to get wxWidgets to crash when using multiple threads

Post by Blingo »

I want to be able to achieve the title in the shortest number of lines of code possible and with the simplest GUI possible. I've tried changing labels and setting button enablement from a worker thread but with no crash. Maybe it isn't possible to guarantee a crash but code with a high likelihood of crashing would also be acceptable.
User avatar
doublemax
Moderator
Moderator
Posts: 19161
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Simplest way to get wxWidgets to crash when using multiple threads

Post by doublemax »

Are you trying to research if it's worth taking the risk to ignore all warnings about this and just do it?

Problems caused by multithreading come when you least expect them and even is some GUI operation may work now, sooner or later it will bite you in the behind.

The platform plays a big role too. AFAIK Windows is more forgiving, GTK crashes much faster if you do a GUI operation from a worker thread.
Use the source, Luke!
Blingo
Knows some wx things
Knows some wx things
Posts: 25
Joined: Tue Dec 17, 2013 3:39 pm

Re: Simplest way to get wxWidgets to crash when using multiple threads

Post by Blingo »

Putting together a "Bad Code" example for interview question.
Post Reply