[haiku-development] Re: address space rwlock issue?
- From: Ingo Weinhold <ingo_weinhold@xxxxxx>
- To: haiku-development@xxxxxxxxxxxxx
- Date: Sun, 15 Mar 2009 23:53:25 +0100
On 2009-03-15 at 20:08:56 [+0100], Jonas Sundström <jonas@xxxxxxxxxxx>
wrote:
> Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
> ...
> > it is not always known
> > which thread is holding a lock.
>
> If the kernel doesn´t know, how can locks work
> reliably, let alone be released when processes exit?
Kernelland is a very controlled environment. Only kernel (proper) and
driver code is executed and that code has certain responsibilities. If a
function acquires a lock, it is also responsible for releasing it,
respectively there's a well-defined strategy how the lock is released (e.g.
some other called function does).
There's only one point where a userland thread can die (regardless whether
it was caused by {exit,kill}_thread() or whatever), which is in the kernel
right before the thread would return to userland. At this point no kernel
locks are held. Kernel threads can only exit explicitly (via exit_thread())
and it is the responsibility of that thread/code that no further kernel
locks are held at that time.
CU, Ingo
- Follow-Ups:
- [haiku-development] Re: address space rwlock issue?
- From: David McPaul
- [haiku-development] Re: address space rwlock issue?
- References:
- [haiku-development] Re: address space rwlock issue?
- From: Jonas Sundström
- [haiku-development] Re: address space rwlock issue?
Other related posts:
- » [haiku-development] address space rwlock issue? - Jonas Sundström
- » [haiku-development] Re: address space rwlock issue? - Rene Gollent
- » [haiku-development] Re: address space rwlock issue? - Ingo Weinhold
- » [haiku-development] Re: address space rwlock issue? - Jonas Sundström
- » [haiku-development] Re: address space rwlock issue? - Adrian Panasiuk
- » [haiku-development] Re: address space rwlock issue? - Adrian Panasiuk
- » [haiku-development] Re: address space rwlock issue? - Ingo Weinhold
- » [haiku-development] Re: address space rwlock issue? - Jonas Sundström
- » [haiku-development] Re: address space rwlock issue? - Jonas Sundström
- » [haiku-development] Re: address space rwlock issue? - Ingo Weinhold
- » [haiku-development] Re: address space rwlock issue? - Jonas Sundström
- » [haiku-development] Re: address space rwlock issue? - Stephan Assmus
- » [haiku-development] Re: address space rwlock issue? - Ingo Weinhold
- » [haiku-development] Re: address space rwlock issue? - David McPaul
- » [haiku-development] Re: address space rwlock issue? - Ingo Weinhold
- » [haiku-development] Re: address space rwlock issue? - Axel Dörfler
- » [haiku-development] Re: address space rwlock issue? - Bruno Albuquerque
- » [haiku-development] Re: address space rwlock issue? - Niels Reedijk
- » [haiku-development] Re: address space rwlock issue? - Ingo Weinhold