Deadlock in VST host application

DSP, Plug-in and Host development discussion.
Xleth
KVRist
75 posts since 24 Mar, 2011

Post Sat Oct 12, 2019 12:38 pm

I posted a question for VST developers at https://stackoverflow.com/questions/583 ... pplication in case anyone knows the answer. If you don't have an account at stackoverflow.com, please post your answer here. Thank you.

mystran
KVRAF
5377 posts since 12 Feb, 2006 from Helsinki, Finland

Re: Deadlock in VST host application

Post Sat Oct 12, 2019 2:05 pm

Trying to run different windows in different threads is a "recipe for pain" in general, so my first suggestion would be to rethink your application design.

That said, if the problem is with modal dialogs in particular, it might have something to do with modal message loops. Specifically, when you call something like MessageBox that call doesn't return before the modal popup is dismissed, so your application message loop doesn't run while the dialog is open. Since the dialog itself still needs a message loop to function though (and to handle repaints for the application window below, etc), what happens is that the modal dialog itself calls a special modal message loop.

What this means in practice is that if your application relies on being able to intercept custom messages directly from the message loop itself, it is never going to work properly in the presence of modal loops, because you can't control what those loops do and therefore they won't be processing your special messages correctly.
If you'd like Signaldust to return, please ask Katinka Tuisku to resign.

Xleth
KVRist
75 posts since 24 Mar, 2011

Re: Deadlock in VST host application

Post Sun Oct 13, 2019 1:39 am

You're probably right that trying to run different windows in different threads is a "recipe for pain" in general.
And, in the meantime, fortunately, I was able to resolve the issue (in that direction).

mystran
KVRAF
5377 posts since 12 Feb, 2006 from Helsinki, Finland

Re: Deadlock in VST host application

Post Sun Oct 13, 2019 10:20 am

Since you keep repeating that you have a custom GUI that doesn't use native APIs (which is obviously not strictly true, because at some point you do need to use native APIs to have any sort of GUI), I have to ask: are you absolutely sure that somewhere inside whatever library you might be using, there isn't a standard message loop (or something close enough) capable of dispatching messages to the plugin windows?

I'm aware that some game oriented libraries do some really weird stuff (eg. SDL intercepting mouse/key input in PumpEvents directly on macOS), but for any "normal" toolkit (ie. basically anything that's supposed to handle multiple windows) I would expect a separate message loop to be unnecessary on both Windows and macOS, even if the actual message loop is buried somewhere deep inside some library.
If you'd like Signaldust to return, please ask Katinka Tuisku to resign.

Return to “DSP and Plug-in Development”