469,578 Members | 1,783 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

diff of advisory lock and mandatory locks

Hi,
Plz, clarify me , with the differences between advisory lock
and mandatory locks.

Thnanks in advance
Bangalore.

Aug 2 '05 #1
2 4466
Not the right place to ask since C++ doesn't know threading, you might
find a better explanation in the newsgroup for the os you are working
on.
That said a mandatory lock blocks access until whatever that has
received the lock releases it. An advisory lock just informs others
accessing that memory/file that someone else is working in that part
already and that they should behave.

Note that advisory locking is also called shared locking and mandatory
locking is also called exclusive locking.

Aug 2 '05 #2
Bangalore wrote:
Hi,
Plz, clarify me , with the differences between advisory lock
and mandatory locks.

Thnanks in advance
Bangalore.

(reposting. Comcast's news feed is fubar)

Advisory locks don't prevent you from accessing the data without
a lock. Mandatory locks do. Advisory locking depends on threads
or processes behaving properly and only accessing the data when
holding a lock.

In order for mandatory locks to be able to be enforcable, there
has to be a mechansim to control all access to the data. In OO
programming that would be by making the data private and only
accessable through method calls. The method implementations would
be responsible for determining whether locking was in effect and
enforcing it properly.
--
Joe Seigh

When you get lemons, you make lemonade.
When you get hardware, you make software.
Aug 2 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by xixi | last post: by
12 posts views Thread by xixi | last post: by
reply views Thread by Bruce Pullen | last post: by
2 posts views Thread by fabio | last post: by
9 posts views Thread by kavallin | last post: by
reply views Thread by cburnett | last post: by
6 posts views Thread by michael.spoden | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.