Subj : Re: SGI: Need Something like 1 Mutual Exclusion Semaphore for Multible Programs To : comp.programming From : clusardi2k Date : Fri Jul 08 2005 11:21 am Tony 'Nicoya' Mantler wrote: > In article <1120742189.678926.138110@g49g2000cwa.googlegroups.com>, > clusardi2k@aol.com wrote: > > : I have a assignment just thrown onto my desk. > : > : What is the easiest way to solve it? Below is a brief > : description of the task. > : > : There are multible programs which use the same library routine > : which is an interface to what I'll call a service program. > : > : The problem is that only 1 request at a time can be serviced by > : the service program. > > There's a few options. You can, in order of decreasing preference: > > * Fix your service program to queue requests > * Add an intermediary service program that queues requests to the service program > * Use some distributed API for locking (since you mention they're on different > machines), like maybe MPI, PVM, or something like RPC > * Use a reject-and-retry collision system > > You could also possibly parallelize your service program so that it can serve > more than one request at a time, or make it transactional if it's not quite > parallelizable. It all depends on what your service program actually does. > > > Cheers - Tony 'Nicoya' Mantler :) Thanks, but how is queuing requests different from parallelizing the service program? .