Re: flock/pthread bug?

2001-07-20 Thread Terry Lambert
Peter Pentchev wrote: > I don't know if Terry was talking about the sched_yield() syscall, > but if he was, then sched_yield(2) exists, at least in 4.x, and is > documented as POSIX-compliant. No. He needs to yield the system CPU, not the CPU for his particular thread. In the user space threads

Re: flock/pthread bug?

2001-07-19 Thread Peter Pentchev
On Thu, Jul 19, 2001 at 09:46:27AM -0400, Louis-Philippe Gagnon wrote: > Lots of ideas to try (esp. since I don't need FIFO); thanks! > > LPG > > - Original Message - > From: "Terry Lambert" <[EMAIL PROTECTED]> [snip] > > To wrap either, you would need to: > > > > retry: > > st = try_n

Re: flock/pthread bug?

2001-07-19 Thread Louis-Philippe Gagnon
Lots of ideas to try (esp. since I don't need FIFO); thanks! LPG - Original Message - From: "Terry Lambert" <[EMAIL PROTECTED]> > Louis-Philippe Gagnon wrote: > > > > From: "Julian Elischer" <[EMAIL PROTECTED]> > > > probably you should try : > > > > > > #define LOCK_NB0

Re: flock/pthread bug?

2001-07-19 Thread Terry Lambert
Louis-Philippe Gagnon wrote: > > From: "Julian Elischer" <[EMAIL PROTECTED]> > > probably you should try : > > > > #define LOCK_NB0x04 /* don't block when locking */ > > > But I do want to block; I just don't want the whole process to block. You can't block just a thread, sin

Re: flock/pthread bug?

2001-07-18 Thread Louis-Philippe Gagnon
From: "Julian Elischer" <[EMAIL PROTECTED]> > probably you should try : > > #define LOCK_NB0x04 /* don't block when locking */ > But I do want to block; I just don't want the whole process to block. > Also if you have shared memory, why not use > > /* Get a spin lock, handle r

Re: flock/pthread bug?

2001-07-18 Thread Julian Elischer
probably you should try : #define LOCK_NB0x04 /* don't block when locking */ Also if you have shared memory, why not use /* Get a spin lock, handle recursion inline (as the less common case) */ #define _getlock_spin_block(mtxp, tid, type) ({ \

flock/pthread bug?

2001-07-18 Thread Louis-Philippe Gagnon
Hi, I've been looking for a way to get inter-process synchronization between multithreaded processes. (I need synchronized access to an area of shared memory between multiple instances of the same process) Since I was using SysV shared memory, I had first thought of using SysV semaphores for s