• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is the custom Semaphore and it's usage even correct?  RSS feed

 
Anirudh Gupta
Ranch Hand
Posts: 49
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it not entirely possible that the ReceivingThread never gets a chance to execute and the SendingThread KEEEEEEPPPSSS....... on executing without leaving the lock on the Semaphore object at all?
I got this example from Jakob Jenkov - Concurrency tutorial.
Can some one please elaborate and explain the example below about how the Semaphore is actually behaving like a Semaphore?



Thanks.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!