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

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -