java.util.concurrent.locks in java


when and how to use above package. Any simple examples in using about thread package. Please advise
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You only need to use the locks package if you're writing your own, low level threading code.

That should be extremely uncommon.

You should instead spend time looking into and learning how to use the higher level classes in the concurrent package:

in particular probably:

If you can master those, you likely won't need to write low level locking code.  (These library classes use that package themselves).

gudii9Author Commented:

any good sample simple examples using above 3 interfaces. please advise
Each of those is a pretty big concept to get your head around.

I'd suggest focusing on ConcurrentHashMap first - it's probably the most commonly used of all the concurrency classes.

Some tutorials here:


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.