[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Re: lightweight protection
From: |
Kieran Mansley |
Subject: |
Re: [lwip-users] Re: lightweight protection |
Date: |
Thu, 20 Feb 2003 17:24:51 +0000 (GMT) |
On Thu, 20 Feb 2003, Marc Boucher wrote:
> Locks should only be held or interrupts blocked during the least possible
> time required to manipulate shared data and avoid races..
In general, yes, but there is a trade off with the overhead it takes to
acquire or free a lock. ie. If you are continually taking and releasing
locks in a tight loop to avoid holding the lock over a piece of code that
doesn't require it, you will find you're spending all of your time on the
locking.
Kieran