java - Difference between ReentrantLock and AbstractQueuedSynchronizer -
can give me examples distinguish reentrantlock , abstractqueuedsynchronizer, under circumstances, should go reentrantlock, verse vice, when should use abstractqueuedsynchronizer.
when should use abstractqueuedsynchronizer
probably never. @ answer in link of comments see uses of aqs. aqs class offers support concurrent constructs. if not writing kind of of lower level concurrency tool should never use aqs. most, if not all, barriers offered in j.u.c should suffice.
can give me examples distinguish reentrantlock , abstractqueuedsynchronizer
a better question distinguish differences between reentrantlock and
- semaphore
- cyclicbarrier
- reentrantreadwritelock
- countdownlatch
each of these classes utilize aqs concurrency support.
Comments
Post a Comment