Bloomberg LP Interview Question






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

mutex have property that only owner can release it. So in a threading environment if some thread sets mutex on some shared address and it goes for long time I/O sleep or not scheduled for a long time (may be cause of lower priority) then other threads needy of that locked address will have to wait (may be infinitely causing deadlock). So generally in some operating systems ,afaik threads reset the mutex lock if any before going to sleep. Any improvements?

- mrn July 17, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

It might be suboptimal in the case that multiple threads read rather than write the shared file, they could do simultaneously rather than one by one.

- orangetime23 May 19, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Mutexes are can cause deadlocks, priority inversion if not handled properly...

- Anonymous August 08, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

A mutex is a lockable object that is designed to signal when critical sections of code need exclusive access. Of course, it prevents other threads with the same protection from executing concurrently and access the same memory locations. If miused on readable/sharable sections, it causes thread holdups and response delays for other threads.

- pitchacool August 27, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 3 vote

If you need synchronization between threads mutexs are costly, use critical sections instead.

- braves July 17, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Not sure what you mean here. Mutexes protect critical section.

- Wolverine September 21, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

what do u mean by "critical sections"??

- SpinLocked January 21, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

please don't create troubles to others by writing stupid answers

- hii February 03, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

knowingly or unknowingly you gave one good answer.. "CRITICAL_SECTION" in MicroSoft Windows is like futex in Linux..
Futexes are userspace locks can be used for coarse lockings... esp.synchronization between multiple threads.. the same applies to CRITICAL_SECTION..

My ignorance..

- SpinLocked February 22, 2012 | 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