Re: synchronization between processes (not threads)

2000-03-15 Thread Matt Fahrner
Just to be clear, I was *not* advocating the use of files as a semaphore. I'm just saying its one of your alternatives. Sometimes you just gotta do what you gotta do (for example from a bourne shell program). Not that I'm trying to get anyone to use this method (I wouldn't) but unless you're flail

Re: synchronization between processes (not threads)

2000-03-15 Thread John Summerfield
> This is a multi-part message in MIME format. > --2FC454B1D9AB31B600F414F0 > Content-Type: text/plain; charset=us-ascii > Content-Transfer-Encoding: 7bit > > Yes a "semaphore" is very portable (at least within Unix environments). > You can also use "flock()" on a file. Another trick

Re: synchronization between processes (not threads)

2000-03-15 Thread John Summerfield
> This is a multi-part message in MIME format. > --425D82A4160873822A800BC6 > Content-Type: text/plain; charset=us-ascii > Content-Transfer-Encoding: 7bit > > Julie wrote: > > Both of the file-based mechanisms can fail if the two > > processes are pounding on a non-local filesystem.

Re: synchronization between processes (not threads)

2000-03-14 Thread Matt Fahrner
Julie wrote: > Both of the file-based mechanisms can fail if the two > processes are pounding on a non-local filesystem. > > They also tend to be DOG SLOW. Agreed. The "semaphore" is the way to go. Of course unless you're trying to synchronize across multiple systems it wouldn't make sense to

Re: synchronization between processes (not threads)

2000-03-14 Thread Julie
Matt, From: Matt Fahrner <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 14, 2000 09:10 Subject: Re: synchronization between processes (not threads) > Yes a "semaphore" is very portable (at least within Unix environments). > You can also use "

Re: synchronization between processes (not threads)

2000-03-14 Thread Matt Fahrner
Yes a "semaphore" is very portable (at least within Unix environments). You can also use "flock()" on a file. Another trick is just to create and destroy a file as a sort of gate condition. - Matt Alan Cox wrote: > > > pthread_mutex_, but this is for threads. Do I u

Re: synchronization between processes (not threads)

2000-03-14 Thread Alan Cox
> pthread_mutex_, but this is for threads. Do I use a semaphore? Seems > like overkill; I just need a binary yes or no lock. Portably you use a semaphore. If you want to be faster and non portable you can use shared memory regions and tricks but those may not work on all cpus -- To unsub

synchronization between processes (not threads)

2000-03-13 Thread Paul Carver
Hello. I'm new to Linux (mostly a Win32 developer). I am porting some code that uses the Win32 CreateMutex in order to synchronize access to a file across several processes. On Win32, a mutex works across processes (not only threads). I remember a class I took years ago allowed file locking as