Re: panic: mutex Giant not owned at /usr/src/sys/kern/tty_ttydisc.c:1127
- From: Julian Elischer <julian@xxxxxxxxxxxx>
- Date: Sat, 24 Jan 2009 15:14:58 -0800
Maksim Yevmenkin wrote:
Hans Petter,
Do mutexes sleep? No? So my code should be fine?
yes, regular mutexes sleep.
Yes and no.
This is a semantic thing..
They don't actually 'sleep', but they do deschedule the thread.
the difference is purely semantic.
Users of mutexes "agree" to never do anything that in indeterminately long while holding the mutex so you are SUPPOSED to get control back in a "short" period of time. Even if multiple mutexes have
dependencies on each other, the fact that none of them may wait
for a "long" time is suposed to guarantee that your thread should get control again "shortly".
It is illegal to sleep while holding a mutex. This helps enforce
this (otherwise small) distinction.
A Sleep may wait for an arbitrary amount of time.. e.g. until reboot.
so doing so with a mutex held would break the agreement.
Effectively the only real difference is that the agreement
by users to not use a mutex when things may get slow.
Spin locks are even more strict..
BTW A mutex that is waiting on a thread on another processor
may spin for a short amount of time before taking the expensive
step of descheduling the thread.
_______________________________________________
freebsd-current@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: panic: mutex Giant not owned at /usr/src/sys/kern/tty_ttydisc.c:1127
- From: Maksim Yevmenkin
- Re: panic: mutex Giant not owned at /usr/src/sys/kern/tty_ttydisc.c:1127
- References:
- panic: mutex Giant not owned at /usr/src/sys/kern/tty_ttydisc.c:1127
- From: Lars Engels
- Re: panic: mutex Giant not owned at /usr/src/sys/kern/tty_ttydisc.c:1127
- From: Hans Petter Selasky
- Re: panic: mutex Giant not owned at /usr/src/sys/kern/tty_ttydisc.c:1127
- From: Maksim Yevmenkin
- Re: panic: mutex Giant not owned at /usr/src/sys/kern/tty_ttydisc.c:1127
- From: Hans Petter Selasky
- Re: panic: mutex Giant not owned at /usr/src/sys/kern/tty_ttydisc.c:1127
- From: Maksim Yevmenkin
- panic: mutex Giant not owned at /usr/src/sys/kern/tty_ttydisc.c:1127
- Prev by Date: Re: panic: mutex Giant not owned at /usr/src/sys/kern/tty_ttydisc.c:1127
- Next by Date: Re: panic: mutex Giant not owned at /usr/src/sys/kern/tty_ttydisc.c:1127
- Previous by thread: Re: panic: mutex Giant not owned at /usr/src/sys/kern/tty_ttydisc.c:1127
- Next by thread: Re: panic: mutex Giant not owned at /usr/src/sys/kern/tty_ttydisc.c:1127
- Index(es):
Relevant Pages
|