wxMax and Multi-Threading

BlitzMax Forums/Brucey's Modules/wxMax and Multi-Threading

TaskMaster(Posted 2008) [#1]
Brucey, should I be able to use wxMax with a Multi-Threaded BlitzMax app? Here is what I have so far:

I wrote an App using wxWidgets. Got it all working. Then decided I wanted one portion of it to be in a separate thread.

I built all of my modules Threaded (including all the wxMax modules). Then when I set my App to compile with threading, the wxApp.Run fails when I shutdown. I have not even used any threading yet.

Have you run across this? Should I even be able to do this?


Brucey(Posted 2008) [#2]
TBH, I haven't tried running anything wxMax related with threading/new GC enabled.
There are no reasons I can think of why it wouldn't work, as wxWidgets already comes with it's own threading functions.

Do you have any idea of the errors being generated on shutdown?


TaskMaster(Posted 2008) [#3]
It just says:

Unhandled Exception:Unhandled Memory Exception Error

And points to:

wx.mod/base.bmx

at this spot (the arrows indicate the line for the error):



Edit to add:

The funny part is, I have a line where I am deleting a file. If I comment out that line, it works, if that line stays in, I get the error. Makes no sense as the file is just a random file on the drive, not having anything to do with the app, and I am not deleting it right before closing (causing a race condition or anything). And I am using the standard Blitz DeleteFile command to delete it.


TaskMaster(Posted 2008) [#4]
Hmmm, some of the samples also get this same error when I run them with Threaded Build turned on. And I haven't changed anything in them. For example, text.bmx.

So, it seems that maybe wxMax is not Multi-Threaded Capable?!?!

If you can find a solution to this, it would be great. But, I think I can get away with staying in single Thread Mode and using wxProcess and kicking off new processes to do the part I wanted to Multi-Thread.


Brucey(Posted 2008) [#5]
From what I have found so far, the errors are appearing inside wxWidgets itself. Perhaps it is not happy running with the new GC.

I'll dig around a bit further though.


TaskMaster(Posted 2008) [#6]
Thanks Brucey...

I was thinking I might use wxProcess and wxDDEClient/Server or wxClient/Server to make my spawned processes communicate with my main app. But I don't see them. Have you not done the interprocess communications widgets? or are they hidden in one of the mods?

Thanks again. wxMax is great.