Sharing variables between C# and C++

I’m writing a software in c# which needs to call many times and by many threads a function in a c++ unmanaged dll.

I have a C++ file like that:

// “variables” which consist in some simple variables …