954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

semaphore.

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

Nemoticchigga
Junior Poster in Training
98 posts since Feb 2008
Reputation Points: 10
Solved Threads: 2
 

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.

vmanes
Posting Virtuoso
1,914 posts since Aug 2007
Reputation Points: 1,268
Solved Threads: 228
 

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? ;)

ArkM
Postaholic
2,001 posts since Jul 2008
Reputation Points: 1,234
Solved Threads: 348
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You