On Fri, 2005-12-16 at 13:41 -0800, Linus Torvalds wrote: > > > > No one. It's not really a mutex, but a completion. > > > > Well, then let us use a completion and not some semantically wrong > > workaround > > It is _not_ wrong to have a semaphore start out in locked state. > > For example, it makes perfect sense if the data structures that the > semaphore needs need initialization. The way you _should_ handle that is > to make the semaphore come up as locked, and the data structures in some > "don't matter" state, and then the thing that initializes stuff can do so > properly and then release the semaphore. > > Yes, in some cases such a locked semaphore is only used once, and ends up > being a "completion", but that doesn't invalidate the fact that this is > a perfectly fine way to handle a real issue. Well, in case of a semaphore it is a semantically correct use case. In case of of a mutex it is not. Gerd was talking about a mutex. The fact that a mutex is implemented on top (or on actually the same) mechanism as a semaphore - for what ever reason - does not change the semantical difference between semaphores and mutexes. tglx - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Linus Torvalds <torvalds@osdl.org>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- References:
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Paul Jackson <pj@sgi.com>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Paul Jackson <pj@sgi.com>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Ingo Molnar <mingo@elte.hu>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Christoph Hellwig <hch@infradead.org>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Ingo Molnar <mingo@elte.hu>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Ingo Molnar <mingo@elte.hu>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: David Howells <dhowells@redhat.com>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: David Howells <dhowells@redhat.com>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: David Howells <dhowells@redhat.com>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Thomas Gleixner <tglx@linutronix.de>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Mark Lord <lkml@rtr.ca>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Andrew Morton <akpm@osdl.org>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Nikita Danilov <nikita@clusterfs.com>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Alan Cox <alan@lxorguk.ukuu.org.uk>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: David Howells <dhowells@redhat.com>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: David Howells <dhowells@redhat.com>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Linus Torvalds <torvalds@osdl.org>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Andrew Morton <akpm@osdl.org>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Steven Rostedt <rostedt@goodmis.org>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Geert Uytterhoeven <geert@linux-m68k.org>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Thomas Gleixner <tglx@linutronix.de>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- From: Linus Torvalds <torvalds@osdl.org>
- Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- Prev by Date: Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- Next by Date: cpufreq broken in 2.6.15-rc5
- Previous by thread: Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- Next by thread: Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
- Index(es):
![]() |