Date: Sun, 12 Mar 2006 13:28:45 +0100 From: Bernd Walter <ticso@cicely12.cicely.de> To: Pranav Peshwe <pranavpeshwe@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Doubts about PICKUP_GIANT() and mtx_lock(&Giant). Message-ID: <20060312122844.GL14157@cicely12.cicely.de> In-Reply-To: <cdfd7d6d0603120255x3039efa2w68c9217f5706e78c@mail.gmail.com> References: <cdfd7d6d0603120255x3039efa2w68c9217f5706e78c@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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@bwct.de info@bwct.de support@fizon.de
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060312122844.GL14157>