[prev in list] [next in list] [prev in thread] [next in thread]
List: opensolaris-networking-discuss
Subject: [networking-discuss] Another question on mutex
From: wendy <wendyj58 () hotmail ! com>
Date: 2007-03-30 11:29:04
Message-ID: 31751496.1175279374957.JavaMail.Twebapp () oss-app1
[Download RAW message or body]
Hi,
Below is the man page of mutex, can someone explain what does the black words mean? \
many of my colleagues are confused. Does it mean that for driver state, we are free \
to change? then how do we protect it?
Wendy
mutex(9F)
Acquiring a lock in user context that is also
acquired in interrupt context means that, as long
as that lock is held, the driver instance holding
the lock is subject to all the rules and limita-
tions of interrupt context.
In most cases, a mutex can and should be acquired
and released within the same function.
Liberal use of debugging aids like
ASSERT(mutex_owned(&mutex)) can help find callers
of a function which should be holding a mutex but
are not. This means you need to test your driver
compiled with DEBUG.
[b]Do not use a mutex to set driver state. However,
you should use a mutex to protect driver state
data.[/b]
Use per-instance and automatic data where possible
to reduce the amount of shared data. Per-instance
data can be protected by a per-instance lock to
improve scalability and reduce contention with
multiple hardware instances.
Avoid global data and global mutexes whenever pos-
sible.
SunOS 5.9 Last change: 16 Mar 2003 4
This message posted from opensolaris.org
_______________________________________________
networking-discuss mailing list
networking-discuss@opensolaris.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic