Re: Questions about mutex implementation in kern/kern_mutex.c

2010-09-17 Thread John Baldwin
On Friday, September 17, 2010 1:42:44 pm Andrey Simonenko wrote: > On Thu, Sep 16, 2010 at 02:16:05PM -0400, John Baldwin wrote: > > On Thursday, September 16, 2010 1:33:07 pm Andrey Simonenko wrote: > > > The mtx_owned(9) macro uses this property, mtx_owned() does not use > > > anything > > > spe

Re: Questions about mutex implementation in kern/kern_mutex.c

2010-09-17 Thread Andrey Simonenko
On Thu, Sep 16, 2010 at 02:16:05PM -0400, John Baldwin wrote: > On Thursday, September 16, 2010 1:33:07 pm Andrey Simonenko wrote: > > > "Current" value means that the value of a variable read by one thread > > is equal to the value of this variable successfully updated by another > > thread by the

Re: Questions about mutex implementation in kern/kern_mutex.c

2010-09-17 Thread John Baldwin
On Thursday, September 16, 2010 11:24:29 pm Benjamin Kaduk wrote: > On Thu, 16 Sep 2010, John Baldwin wrote: > > > On Thursday, September 16, 2010 1:33:07 pm Andrey Simonenko wrote: > > > >> The mtx_owned(9) macro uses this property, mtx_owned() does not use > >> anything > >> special to compare

Re: Questions about mutex implementation in kern/kern_mutex.c

2010-09-16 Thread Benjamin Kaduk
On Thu, 16 Sep 2010, John Baldwin wrote: On Thursday, September 16, 2010 1:33:07 pm Andrey Simonenko wrote: The mtx_owned(9) macro uses this property, mtx_owned() does not use anything special to compare the value of m->mtx_lock (volatile) with current thread pointer, all other functions that

Re: Questions about mutex implementation in kern/kern_mutex.c

2010-09-16 Thread John Baldwin
Hello, > > > > > > I have questions about mutex implementation in kern/kern_mutex.c > > > and sys/mutex.h files (current versions of these files): > > > > > > 1. Is the following statement correct for a volatile pointer or integer > > &

Re: Questions about mutex implementation in kern/kern_mutex.c

2010-09-16 Thread Andrey Simonenko
On Wed, Sep 15, 2010 at 08:46:00AM -0700, Matthew Fleming wrote: > I'll take a stab at answering these... > > On Wed, Sep 15, 2010 at 6:44 AM, Andrey Simonenko > wrote: > > Hello, > > > > I have questions about mutex implementation in kern/kern_mutex.c > >

Re: Questions about mutex implementation in kern/kern_mutex.c

2010-09-15 Thread John Baldwin
On Wednesday, September 15, 2010 11:46:00 am Matthew Fleming wrote: > I'll take a stab at answering these... > > On Wed, Sep 15, 2010 at 6:44 AM, Andrey Simonenko > wrote: > > Hello, > > > > I have questions about mutex implementation in kern/kern_mutex.c

Re: Questions about mutex implementation in kern/kern_mutex.c

2010-09-15 Thread Matthew Fleming
I'll take a stab at answering these... On Wed, Sep 15, 2010 at 6:44 AM, Andrey Simonenko wrote: > Hello, > > I have questions about mutex implementation in kern/kern_mutex.c > and sys/mutex.h files (current versions of these files): > > 1. Is the following statement

Questions about mutex implementation in kern/kern_mutex.c

2010-09-15 Thread Andrey Simonenko
Hello, I have questions about mutex implementation in kern/kern_mutex.c and sys/mutex.h files (current versions of these files): 1. Is the following statement correct for a volatile pointer or integer variable: if a volatile variable is updated by the compare-and-set instruction (e.g