[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20071129075615.GA9962@ff.dom.local>
Date: Thu, 29 Nov 2007 08:56:15 +0100
From: Jarek Poplawski <jarkao2@...pl>
To: davids@...master.com
Cc: larry.finger@...inger.net, LKML <linux-kernel@...r.kernel.org>
Subject: Re: Question regarding mutex locking
On 29-11-2007 03:34, David Schwartz wrote:
>> Thanks for the help. Someday, I hope to understand this stuff.
>>
>> Larry
>
> Any code either deals with an object or it doesn't. If it doesn't deal with
> that object, it should not be acquiring locks on that object. If it does
> deal with that object, it must know the internal details of that object,
> including when and whether locks are held, or it cannot deal with that
> object sanely.
...
Maybe it'll unnecessarily complicate the thing, but since you repeat
the need to know the object - sometimes the locking is done to
synchronize something in time only, so to assure only one action is
done at a time or a few actions are done in proper order, or/and
shouldn't be broken in the meantime by other actions (so, no need
to deal with any common data).
But, of course, we can say an action could be a kind of object too.
Regards,
Jarek P.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists