Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: locks

Thread Tools

Re: locks

Cliff Wells
Posts: n/a
On Wed, 2004-10-13 at 21:05 +1000, Ajay wrote:
> hi!
> what would happen if i try to access a variable locked by another thread? i
> am not trying to obtain a lock on it, just trying to access it.

First of all, why not just try it and see? Secondly, nothing will
prevent you from accessing it. Locks in Python are advisory only. Just
be aware that locks typically exist for a reason. Just because you
aren't modifying the variable doesn't mean you won't shoot yourself in
the foot. If the variable is mutable (such as a list or dictionary),
then you risk seeing a partially updated variable if the other thread is
in the midst of updating it. This may be acceptable for your
application or it may not.


Cliff Wells <(E-Mail Removed)>

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox locks up on first URL sometimes; Sometimes closes itself Jim Firefox 0 06-28-2005 01:42 PM
FireFox V1.0 locks up mosemoots Firefox 3 01-20-2005 02:02 PM
Wireless keyboard locks out the system!! =?Utf-8?B?RnJ1c3RyYXRlZA==?= Wireless Networking 0 09-06-2004 09:19 PM
File sharing locks up my laptop Tony Marston Wireless Networking 4 07-07-2004 08:56 PM
4006 SUP III locks up Flemming Haurum Cisco 0 11-01-2003 12:07 PM