After reading the previous chapters on locks and synchronization, you may be wondering, how would I choose a locking mechanism for my multi-threaded code?
Well, before we answer this doubt, using synchronized methods or blocks is much easier than using the explicit locking mechanism. Using the synchronized keyword, you need not manually grab and release the lock so, the chances of any