Garbage Collector and Foreign Threads

will75g will75g at yahoo.it
Tue Mar 20 14:59:39 PDT 2007


Frits van Bommel will75g wrote:
> So that would mean the GUI thread of your plugin would have to be the 
> main thread?
> Then perhaps the proxy object created by std.thread for the main thread 
> mentioned somewhere in this thread would be able to handle this on OSX, 
> and you could use above method for win32?
> (Assuming by 'PC' above you meant win32, and not e.g. Linux as well. If 
> you also need to support other PC platforms, you'll need to figure out 
> what works there)
> You may want to create some kind of OS abstraction layer for this if you 
> try to implement it.
> 
> This is obviously not as nice as a cross-platform solution. On the other 
> hand, it might actually work. Which is after all a very important 
> quality for a program to have...

Yes, by PC I mean win32... unfortunately linux is rather irrelevant for 
audio applications.
The solution you're proposing would work with the simplified model I 
described. But audio plug-ins are a mess... The whole truth is that 
you're guarantee to have a GUI and an audio thread, but there could be 
more. Some notifications from the host are performed from an unspecified 
thread: it can be the GUI thread, the audio thread or a completely 
different thread, there's no standard for this and each host implements 
it in a different way, so the plug-in must be able to adapt to every 
possible situation... That's way I look for a generic solution. Being 
able to identify a foreign thread and wrapping it in a proxy thread 
looks like the most promising solution so far.


More information about the Digitalmars-d-learn mailing list