• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
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.
 
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic