# VSTPluginInstance and Scanning on a Different Thread

**URL:** <https://forum.juce.com/t/vstplugininstance-and-scanning-on-a-different-thread/10392>\
**Category:** Audio Plugins\
**Created:** [May 3, 2013, 2:48pm UTC](https://forum.juce.com/t/vstplugininstance-and-scanning-on-a-different-thread/10392 "2013-05-03T14:48:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrlanglois](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jrlanglois/32/21372_2.png) [@jrlanglois](https://forum.juce.com/u/jrlanglois)\
**Post date:** [May 3, 2013, 2:48pm UTC](https://forum.juce.com/t/vstplugininstance-and-scanning-on-a-different-thread/10392/1 "2013-05-03T14:48:27Z")

</div>

Hi Jules,

Since you provide a means of scanning for plugins on a different thread, would you mind also providing a macro for turning off the following assertion in juce\_VSTPluginFormat.cpp?

```auto
#if JUCE_WINDOWS
// On Windows it's highly advisable to create your plugins using the message thread,
// because many plugins need a chance to create HWNDs that will get their
// messages delivered by the main message thread, and that's not possible from
// a background thread.
jassert (MessageManager::getInstance()->isThisTheMessageThread());
#endif
```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 3, 2013, 3:00pm UTC](https://forum.juce.com/t/vstplugininstance-and-scanning-on-a-different-thread/10392/2 "2013-05-03T15:00:10Z")

</div>

Well, I actually provide those callbacks to allow scanning in a different _process_. I wouldn’t really recommend doing it on a different thread, because some plugins may get confused if you don’t use the main thread.

---

<div class="post-metadata">

**Author:** ![jrlanglois](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jrlanglois/32/21372_2.png) [@jrlanglois](https://forum.juce.com/u/jrlanglois)\
**Post date:** [May 3, 2013, 3:14pm UTC](https://forum.juce.com/t/vstplugininstance-and-scanning-on-a-different-thread/10392/3 "2013-05-03T15:14:16Z")

</div>

:shock: Woops! Pardon my confusion, and good point…

---

<div class="post-metadata">

**Author:** ![jrlanglois](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jrlanglois/32/21372_2.png) [@jrlanglois](https://forum.juce.com/u/jrlanglois)\
**Post date:** [May 3, 2013, 9:00pm UTC](https://forum.juce.com/t/vstplugininstance-and-scanning-on-a-different-thread/10392/4 "2013-05-03T21:00:22Z")

</div>

Hey Jules,

I do understand your point… but I’m not understanding the feature of scanning on a different thread that you added a while ago - which you have just now upgraded to a ThreadPool? How can that work - or is it just not for use with VSTs?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 3, 2013, 9:03pm UTC](https://forum.juce.com/t/vstplugininstance-and-scanning-on-a-different-thread/10392/5 "2013-05-03T21:03:19Z")

</div>

It’s how tracktion works, but it only makes sense if you implement a custom scanner that uses a child process to do the scan.
