I do not really understand the concept of semaphores in Java and try to understand it.
My understanding after reading the oracle docs (http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/Semaphore.html) and some other pages that looks like a lock with counting the number of permissions.
It is usually used to create resource pools. I got confused here, there is also a ThreadPoolExecutor that can give me a thread pool. So what is the difference? Which one is used in which scenario?
mehta source
share