For a school project, I'm currently working with an external C++ library that I compile next to my own code. It works quite well, like this:
API_InitialiseProgram();
API_ComputeMyStuff(input_data);
Result output_data = API_GetResults();
Since I need to make use of the API for lots of different input data, I call upon these methods a lot. I figured I would make this code parallel. My first try of just running this code a few times in different threads of course didn't work, because the library uses globals.
Now I was wondering, it would stand to reason that I can make 'instances' of this library. So I can then concurrently run my code with different input in each instance. Is this hunch right? Or am I pursuing a dead end?