Re: deadlock avoidance?

Johannes Erdfelt (jerdfelt@sventech.com)
Tue, 7 Dec 1999 19:53:42 -0500


On Wed, Dec 08, 1999, Davide Libenzi <dlibenzi@maticad.it> wrote:
> Wednesday, December 08, 1999 1:32 AM
> Davide Libenzi <dlibenzi@maticad.it> wrote :
> > Wouldn't lock->pid need to be atomic?
> >
> > On x86 this shouldn't be an issue since atomic_read has no magic but on
> > other architectures, lock->pid setting and reading may race.
>
> All pid and count modify fall inside 1) a nested lock ( ie. the task
> already own the lock : ++lock->count )
> 2) a lock acquired : lock->pid = getpid() and ++lock->count

The setting is, but not all of the reading.

JE

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/