This is a general question.

I am familiar with accessors and mutators (getters and setters). I have now been reading up on semaphores. I am having trouble finding out differences between them/how they are related. Can anyone help me out with an explaination or a link? Thanks.

P.S. - sorry if this is not the correct forum

8 Years
Discussion Span
Last Post by ArkM

The main difference between semaphores and accessors/mutators is that semaphores are for signaling some state between threads, which might prohibit the use of accessor/mutator at a given moment in time. A Google search will turn up lots of good links that explain the thread control issue using semaphores, mutex, or other methods. A textbook on operating systems is usually another good source.


In other words, accessors/mutators and semaphores are absolutely different beasts. Accessors and mutators are member functions. Semaphores are objects with special sets of operations and values. In generally semaphores are rather types and accessors/mutators are essentially operations.

So the question looks like what's a difference between door-handles and padlocks? ;)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.