I am working on a Dot Net project that includes a DLL. This DLL uses .lib (C code). Unfortunately, there are many static variables in this .lib. I have a problem here:
If two users search at the same time, I get an error because they both access .lib, one changes something, and the other tries to read the data.
The obvious solution would be to block access, but I really do not want to do this, because it significantly slows down the search process. I would prefer to make the DLL from lib, but I do not know if this will solve the problem, since I do not know whether the static variables will be stored separately or if both search processes will access the same variables.
Does anyone have any experience? Because it will take quite a while, and I would like to know if this works before I start doing it.
I hope everything is clear, since English is not my first language, and my programming skills are quite simple.
source
share