What's the difference between
and
Enter two words to compare and contrast their definitions, origins, and synonyms to better understand how those words are related.

Semaphore vs Mutex - What's the difference?

semaphore | mutex |

As nouns the difference between semaphore and mutex

is that semaphore is any visual signaling system with flags, lights, or mechanically moving arms while mutex is an object in a program that serves as a lock, used to negotiate mutual exclusion among threads.

As verbs the difference between semaphore and mutex

is that semaphore is to signal using (or as if using) a semaphore while mutex is {{cx|computing|programming|transitive|lang=en}} To apply a mutex to.

semaphore

Noun

(en noun)
  • Any visual signaling system with flags, lights, or mechanically moving arms.
  • * 2008 , Gene Weingarten, Old Dogs: Are the Best Dogs , Simon & Schuster, page 4 [http://books.google.com/books?id=GOUMoGLf9tYC&printsec=frontcover&dq=gene+weingarten&source=bl&ots=BgRdWbPGYP&sig=gd-Mgu3cNEgerci0w2psNOA6ZjM&hl=en&sa=X&ei=GDIVUNqbDcOYqAGZx4HgBQ&ved=0CDgQ6AEwAQ#v=onepage&q=semaphore&f=false]:
  • Consider the wagging tail, the most basic semaphore in dog/human communication.
  • A visual system for transmitting information by means of two flags that are held one in each hand, using an alphabetic and numeric code based on the position of the signaler’s arms.
  • (computing) A bit, token, fragment of code, or some other mechanism which is used to restrict access to a shared function or device to a single process at a time, or to synchronize and coordinate events in different processes.
  • Verb

    (semaphor)
  • (intransitive) To signal using (or as if using) a semaphore.
  • * 1990 , (Peter Hopkirk), The Great Game , Folio Society 2010, p. 425:
  • Minutes later, unseen by the defenders, he semaphored back across the valley that he was going to make a fresh attempt.

    mutex

    English

    Noun

    (es) (wikipedia mutex)
  • (computing, programming) An object in a program that serves as a lock, used to negotiate mutual exclusion among threads.
  • Verb

    (en-verb)
  • To apply a mutex to.
  • * 2002 , "Steve Connet", Re: best way to interrupt a select() call in a (POSIX) thread?'' (on newsgroup ''comp.programming.threads )
  • Or you can have a single pipe that is mutexed' so each thread can only write to the pipe exclusively. Alternatively, you can have each thread put the finished fd in a globally ' mutexed list.