Where the code is:function A(){    lock()    doSomething()    unlock()}We can call A safely from multiple threads, but it never be executed in parallel . For parallel execution, we have to evade all of this code.But the problem is we never know the A is getting lock or not. If we have source code (maybe lucky case), we have to decode all code to know locking is happening or not. This sucks. But even worse is we normally have no source code. And about the case of the lock is exist on base library?It's obvious this kind of hidden locks will become bottleneck of parallel execution even all the other parts are designed for parallel. And also, (1) With locks, execution cannot be parallel. (2) And I can't know whether the locks are used or not in any code. (3) Defensively saying, I can't make parallel anything!This facts drives me crazy. How do you solve this problem?
How to you solve the problem of implicit locking and parallel execution?
multithreading;parallelism