Subj : Re: Boss Told Me You Can't Use Semaphore, But I Have To Do Something like It! To : comp.programming.threads From : David Schwartz Date : Wed Jul 13 2005 12:32 pm "Chris Friesen" wrote in message news:42D52478.6050501@nortel.com... > David Schwartz wrote: >> By the way, you can always use a file and protect it with file locks. >> Otherwise, you'd need something ugly like a process-shared mutex. > Maybe I'm missing something: from the original post this is all between > processes already, so why is a process-shared mutex uglier than a > process-shared semaphore or a sysV semaphore? Semaphores were originally designed to be process-shared and do this in a natural way. Mutexes were originally designed to be process-local, and have process-shared support hacked on. For example, to create a semaphore, you just call the semaphore create function. To create a process-shared mutex, you have to allocate shared memory and then put the mutex in it. It is not that a process-shared mutex is much worse. It just is worse. And perhaps it really is much worse, depending upon the reason he can't use a semaphore, which we don't know. DS .