Multi-threaded applications may need to coordinate threads that share data or other resources. Different processes may need to coordinate with each other as well.
The sequence matters, in order to guarantee the results’ correctness. And meanwhile we definitely want to improve the performance.
So what are the common approaches for this? And what are the pros and cons?
|Lock & Metasphore|
|Implement Thread-safe queue/hashmap|
Q: How to detect dead lock and prevent it?
Q: Synchronous vs. Asynchronous
With async architectures, we can scale out for better performance.
But with sync architectures, the performance may not improve, even if we are willing to add more infrastures.
e.g, performance bottlenecks are at applications, instead of Databases. And the application has lots of locks and even starvations.