Skip to content
  • All Tutorials
  • Java Basics
  • Java Core
  • Java EE
  • Spring
  • Android
  • Misc Tutorials
  • Raspberry Pi

Java Tutorial Network

Java Tutorials for Beginners and Professionals

Semaphore

Java Mutex Example

October 24, 2019November 16, 2019 ym_coding
java-featured-image

Let’s give an example first before going deeper into what Mutex is: Think of a queue. Doesn’t matter short or long. Now think of a truck that is selling tickets for an amusement park. One person at a time can buy a ticket. When the person has bought the ticket, it is time for the…

Continue reading →
Java Core java, mutex, Semaphore Leave a comment

Java Semaphore example

October 24, 2019November 16, 2019 ym_coding
java-featured-image

Semaphore can be used to limit the amount of concurrent threads and essentially, this class maintains a set of permits. acquire() takes a permit from the semaphore and release() returns the permit back to the semaphore.  In the event of absence of permits, acuire() will block until one is available Semaphore is used to control…

Continue reading →
Java Core, Uncategorized java, mutex, Semaphore Leave a comment
GET INVOLVED
Follow us on:

Categories

  • Android (21)
  • Articles (39)
  • Get Involved (5)
  • Java Basics (18)
  • Java Core (85)
  • Java EE (18)
  • Misc Tutorials (14)
  • Raspberry Pi (9)
  • Spring (32)
  • Uncategorized (8)

Sponsors



become a sponsor

Java Tutorial Network
Copyright © 2022 JavaTutorial.net, All rights reserved. | Terms of Use | Privacy Policy | Contact Us | Submit Guest Post
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more