I need to create some dylib/dll that my plugins can use it simoltunously and communicate with each other. I’ve already used
InterprocessConnection and it’s fine. But I would like to try dynamic libraries while I think it will give me much more possibilities, am I right?
I’ve never created any dynamic library. I see there is option in Projucer templates to chose Dynamic Library. But I have no idea how to start with it. I tried to find some tutorials but without success.
Could anyone give me any advice how to start with dynamic libraries. I’ve already passed only that tutorial: C++ Creating Shared Library on macOS - YouTube
And it works fine but it is as simple as possible and I have no idea how to use it with audio plugin.
For any help great thanks in advance.
Dynamic libraries won’t help you here. They allow multiple programs to share the same code - say plugin A needs some function
foo() and so does plugin B, a shared library can provide it and you don’t need two copies of the library on the system, or even in memory. But if
foo is setting some global state, then plugin
A isn’t going to be able to share that state with plugin
In other words: you can use shared libraries to share code, not data (*). It’s not a tool you can use for IPC (**).
(*) but just because you can doesn’t mean you should. Shared libraries have a host of other problems to deal with and are usually inadvisable.
(**) there may be some extremely hacky ways you could do this but stick to shared memory, sockets, and named pipes for IPC. That’s why they exist.
InterprocessConnection is the right abstraction.
Hmm… great thanks for your reply. I understand, and I think you saved me a lot of time