Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Thu, 15 Dec 2005, Thomas Gleixner wrote:
> 
> Well, depends on the POV. A counting sempahore is a different beast than
> a mutex. At least as far as my limited knowledge of concurrency controls
> goes.

A real semaphore is counting. 

Dammit, unless the pure mutex has a _huge_ performance advantage on major 
architectures, we're not changing it. There's absolutely zero point. A 
counting semaphore is a perfectly fine mutex - the fact that it can _also_ 
be used to allow more than 1 user into a critical region and generally do 
other things is totally immaterial.

It's _extra_ stupid to re-use the names "down()" and "up()" on a 
non-counting mutex, since then the names make zero sense at all. Use 
"lock_mutex()" and "unlock_mutex()" or something, and don't break existing 
code for no measurable gain.

			Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux