Forums Register Login

Regarding Monitor & Semaphore

+Pie Number of slices to send: Send
HI,

I have the fallowing doubt

what is the difference between a Monitor and a Semaphore ?

thanks in advanced,

Johnson
+Pie Number of slices to send: Send
 

Originally posted by Johnson David:
HI,

I have the fallowing doubt

what is the difference between a Monitor and a Semaphore ?

thanks in advanced,

Johnson



These are just different terminologies. A Monitor is best regarded as a generic term for a synchronization lock, although I have seen cases where it is used to refer to the condition variable functionality too. (The condition variable is the wait()/notify() support of the object class)

A semaphore is also a generic term for a synchronization lock -- although it is not used very often in this regard. Most likely, when this term is used, it is used to refer to a counting semaphore, which is a lock that keeps track of a count of permits. With Java 5.0, counting semaphore support was added with the Semaphore class.

Henry
You've gotta fight it! Don't give in! Read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2472 times.
Similar Threads
Needs help
doubt
I have doubt on jsf
doubt on HashMap
doubts about Webpshere process server and websphere integration development
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 09:16:36.