VMWare Inc Interview Question for Software Engineer / Developers






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

Spinlock : A process will be busy waiting for the shared resource to be set free by other process for use
Advantage: No context switch overhead - useful when locks are expected to be held for short times

Mutex: The waiting process is swapped and put on the waiting list of the shared resource - it gives way to other processes to use the CPU

- Anonymous March 21, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Spinlock : A process will be busy waiting for the shared resource to be set free by other process for use
Advantage: No context switch overhead - useful when locks are expected to be held for short times

Mutex: The waiting process is swapped and put on the waiting list of the shared resource - it gives way to other processes to use the CPU

- anon March 21, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Where to use:
Spinlocks are efficient if threads are only likely to be blocked for a short period of time, as they avoid overhead from operating system process re-scheduling or context switching. For this reason, spinlocks are often used inside operating system kernels. However, spinlocks become wasteful if held for longer durations, both preventing other threads from running and requiring re-scheduling. The longer a lock is held by a thread, the greater the risk that it will be interrupted by the O/S scheduler while holding the lock. If this happens, other threads will be left "spinning" (repeatedly trying to acquire the lock), while the thread holding the lock is not making progress towards releasing it. The result is a semi-deadlock until the thread holding the lock can finish and release it. This is especially true on a single-processor system, where each waiting thread of the same priority is likely to waste its quantum (allocated time where a thread can run) spinning until the thread that holds the lock is finally finished.

- rockshan November 01, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

spinlocks are mainly used in multi-processor systems.

- aaa August 09, 2010 | Flag


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