Unix Programming - newbie question on synchronization constructs

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > October 2006 > newbie question on synchronization constructs





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author newbie question on synchronization constructs
Digital Puer

2006-10-19, 1:26 am

Hi, I keep getting this question on programming interviews
(C++/Java on Linux platforms): In the context of Linux and Posix,
what is the difference between semaphores, mutexes, and
condition variables?

I know the difference in principal from academic textbooks,
but I do not know the practical differences in terms of
the Posix APIs (if that's applicable at all). I BS'ed the
interviewer basically that: semaphores are counting
semaphores; mutexes are binary semaphores; and
condition variables are used for signalling wait/notify
for monitors (such as those in Java) but threads
using monitors do not block on condition variables
but rather on mutexes guarding the condition variables.
Is any of this right?

Some help would be appreciated.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com