Re: locks

Discussion in 'Python' started by Cliff Wells, Oct 13, 2004.

  1. Cliff Wells

    Cliff Wells Guest

    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.

    Regards,
    Cliff

    --
    Cliff Wells <>
    Cliff Wells, Oct 13, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Heavey

    ASPNET_wp locks my machine up

    Jim Heavey, Oct 15, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    385
    Jim Cheshire [MSFT]
    Oct 16, 2003
  2. Tom Pester

    Migrating to ADO.NET and locks

    Tom Pester, Oct 19, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    400
    Natty Gur
    Oct 20, 2003
  3. Rob Mayo
    Replies:
    3
    Views:
    461
    Joao S Cardoso [MVP]
    Nov 22, 2003
  4. Earl Teigrob
    Replies:
    3
    Views:
    342
    Alvin Bruney [MVP]
    Mar 4, 2004
  5. Karl Bauer

    Server.Execute locks dll

    Karl Bauer, Jun 3, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    347
    Karl Bauer
    Jun 3, 2004
Loading...

Share This Page