Qualcomm Interview Question






Comment hidden because of low score. Click to expand.
0
of 0 vote

Mutex is a binary semaphore . Mutex allows only one thread of execution in controlled section at one time forcing all other thread to wait for it to exit .
Semaphore restricts the number of simultaneous users of a shared resource . Initially it is equal to maximum number of resource available . Threads can request access to the resource (decrementing the semaphore), and can signal that they have finished using the resource (incrementing it )

- JD January 25, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

one more difference between mutex and semaphore is:
in mutex, only the process which locked the resource can unlock it.
while in semaphore, one process can put lock(decrements value) and other can unlock
e.g.: producer consumer problem

The semaphore type mentioned by JD is known as counting semaphore, where semaphore variable can have value greater than one.
semaphore variable which can have only 0 or 1 is known as binary semaphore.

- sp!de? March 24, 2012 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More