# Plugin instance id?

**URL:** <https://forum.juce.com/t/plugin-instance-id/9969>\
**Category:** Audio Plugins\
**Created:** [February 14, 2013, 8:39am UTC](https://forum.juce.com/t/plugin-instance-id/9969 "2013-02-14T08:39:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ozzjay](https://avatars.discourse-cdn.com/v4/letter/o/a183cd/32.png) [@ozzjay](https://forum.juce.com/u/ozzjay)\
**Post date:** [February 14, 2013, 8:39am UTC](https://forum.juce.com/t/plugin-instance-id/9969/1 "2013-02-14T08:39:00Z")

</div>

Whats the best way to find the instance number or id of a plugin. If I insert multiple instances of my plugin, i need to know what my instance count is. I tried by declaring a static int MY\_INSTANCE\_ID; as a global in my pluginProcessor.h and incrementing MY\_INSTANCE\_ID++; in createPluginFilter(); . However the instance id does not seem to be incrementing, it’s 0 for all the instances. Any ideas? Also, I actually need to share some variables between different instances of my plugin (in real time, sample accurate) I managed to do this about a year ago using static variables as globals before, but when I try it now with the latest juce, its not working, what could have changed? Cheers…

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [February 14, 2013, 11:39am UTC](https://forum.juce.com/t/plugin-instance-id/9969/2 "2013-02-14T11:39:31Z")

</div>

its by the OS/Host/Juce if you plugin instances sharing the same Process-Environment/Memory/Namespace, so the only way to make this always working is to use Interprocess-communication techniques.
