There is a problem with the ActionBroadcaster when it is used in a 64 bit application on Windows to send messages from one thread to another.
The same code used in 32 bit applcations on Windows or 32 and 64 bit applications on Mac is fine. However a 64 bit application on Windows produces deadlock like situations
In the last months I’ve developed three completely different audio plugins and each of them ended up to freeze the system for I while when I loaded the 64 bit VST or 64 bit AAX plugin on Windows, no matter which host was used.
The same plugin code runs fine as 32 bit AAX or VST on Windows and 32 bit and 64 bit AU/VST/AAX on Mac. The only thing the plugins had in common was that there where messages sent from the processor thread to the gui thread using an ActionBroadcaster / Actionlistener.
Finally I made a simple test plugin that uses the totally basic code created by the Introjucer. The only thing I’ve added is to make the AudioProcessor an ActionBroadcaster and the Editor an ActionListener.
Each time the processBlock is entered I send one ActionMessage and the GUI acts as an ActionListener and repaints a coloured rectangle when it receives a message. Nothing else was added.
This simple testcase shows the same behaviour:
Everything works fine except 64 bit VST and 64 bit AAX plugins when they are loaded into a 64 bit host. After the playback is running for a random while the computer freezes. Sometimes for seconds and sometimes for minutes.
The more I move the plugin window or I switch the focus from the PluginEditor window to the host and back, the more often the freezes appear. Sometimes it freezes immidiately and sometimes it takes a minute or two.
As soon as the call to sendActionMessage() is removed, the freezes are gone.
Are there any issues with thread safety of the ActionBroadcaster? Or is this class simply not designed for what I’m trying to achieve? If so, why does it work on all platforms except for 64 bit Windows?
I’ve attached the slightliy modified TestPlugin code produced by the Introjucer.
Unfortunately I couldn’t attach the compiled 64 bit Windows VST plugin DLL as well, because of the upload size restriction of 512 kB.
If you don’t want to compile it yourself I could send you the binary via email.
Jules, it would be nice if you could have a look at this.
You can download the compiled DLL here: