Doubts about PICKUP_GIANT() and mtx_lock(&Giant).
Bernd Walter
ticso at cicely12.cicely.de
Sun Mar 12 12:28:54 UTC 2006
On Sun, Mar 12, 2006 at 04:25:07PM +0530, Pranav Peshwe wrote:
> Hello,
> What is effectively the difference between PICKUP/DROP_GIANT and
> mtx_lock/unlock(&Giant) ? From the macro expansion, i surmise that
> PICKUP/DROP_GIANT deals with recursion in Giant locking.Is this correct ? is
> this the only difference ? What will happen if i mix the usage of
> PICKUP/DROP_GIANT and mtx_lock/unlock(&Giant) ?
You can't mix them, because they are used in different situtation.
You call DROP_GIANT and later PICKUP to handle situations where it
is required to drop GIANT for a while.
You call mtx_lock and later unlock to hold GIANT for a while.
--
B.Walter http://www.bwct.de http://www.fizon.de
bernd at bwct.de info at bwct.de support at fizon.de
More information about the freebsd-hackers
mailing list