I have been asked to put a constraint that users should not be able to concurrently execute part of the code that calls C++ unmanaged code from ASP.Net/C# web application.
I wanted to ask if placing lock(someobject) around the C# code which is in a C# class library that calls the PInvoke/C++ code is sufficient to ensure that only one user will be able to execute the code? or is there another technique?
I might have to host this code as a WCF service. Would this approach would work too?