When you have a web app which uses a database as repository, all the DAL calls from the business logic aren’t synchronized.
I know that each request is designated a thread for processing, which means that the db access is somehow multithreaded – but I have seen no synchronization code in the app and it magically works.
The question would be the following:
I have a business logic which calls a wrapper over some unmanaged code. Should the call to the unmanaged code be protected by some sync code? #
The unmanaged DLL is not multi-threaded. It accesses some files and it unpacks them.
There is no need to synchronize the threads accessing a DATABASE, as it is one of the defining properties of a (non stone-age) DB to be “quite able of handling that, thank you”.
Now by your definition your unmanaged DLL does not share this property, which means different rules apply or you will crash and burn.
There are many ways to achieve your goal, the most common being