Java — java.util.concurrent package | Code Factory

  1. We are not having any flaxibility to try for a lock without waiting.
  2. There is no way to specify maximum waiting time for a thread to get lock. So that thread will wait until getting the lock which may creates performance problems which may cause deadlock.
  3. If a thread release a lock then which waiting thread will get that lock we are not having any control on this.
  4. There is no API to list out all waiting thread for a lock.
  5. Sychronized keyword compulsory we have to use either at method level or within the method and it is not possible to use across multiple methods.
  • To overcome these problems SUN people introduced java.util.concurrent.locks package in 1.5V.
  • It also provides several enhancement to the programmers to provide more control on concurrency.




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

c-lightning v0.10.1 — “eltoo: Ethereum Layer Too”

How to Increase Productivity for Your Software Development Team

API and API Testing — A Walkthrough

Run parallel jobs with make commands in C++

Makers Academy W6 D4 — Fake it ‘til you make it.

Azure AD B2B vs Azure AD B2C

How to Deploy a Cython Package to PyPI

A big pile of cardboard boxes.

Testing strategis for future implementation (example 1) for binance futures

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Code Factory

Code Factory

More from Medium

From JAVA 9 to JAVA 15: Evolutions and new features — Part 1

Unit Testing Apache Camel

Exploring What’s Inside java.util.concurrent Package (Part 1)

Batch Processing Using CompletableFuture and Blocking Queue Under High Concurrency Scenario