Assume we have a legacy C file with some functions to solve linear equations and several corresponding global variables.

lineq.c:

```
/* macro definitions */
...
/* global vars */
...
/* some functions that make use of above variables */
void solveLinEq(...);

```

Now we want to use this legacy library in a modern multi-threaded C++ application. Therefore, we want to write a kind of wrapper class `LinEqSolver` that provides an OO interface for solving linear equations and internally calls the functions of our legacy C library.

However, it should be possible that there are multiple instances of `LinEqSolver` used by different threads. This requires that each instance/each thread has its own copies of the global variables in `lineq.c`. How can this be achieved, if we don't want to modify the `lineq.c`?

A possible solution I can imagine is to copy the global variables and the functions from the C file into the class `LinEqSolver`, making them data and function members. Then, each instance of `LinEqSolver` would operate on its private copy of the former globale variables. However, this copy-paste programming style is rather bad, especially when there is an update to `lineq.c` and we need to copy-paste the changes into our code again.

What other possibilities do I have where the actual code to solve linear equations stays in `lineq.c` and is just called from `LinEqSolver`?