Manipulating instance var from a static method - thread safe?

Discussion in 'ASP .Net' started by Oleg Ogurok, Jun 18, 2004.

  1. Oleg Ogurok

    Oleg Ogurok Guest

    Hi all,

    I've just realized that static data are not thread safe because they are
    shared by all users of the ASP.NET application. What if a static method is
    passed an object variable? Do I still need to lock() on that variable for
    the time the method is manipulating it?

    Thanks,
    -Oleg.
    Oleg Ogurok, Jun 18, 2004
    #1
    1. Advertising

  2. No.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Oleg Ogurok" <> wrote in message
    news:...
    > Hi all,
    >
    > I've just realized that static data are not thread safe because they are
    > shared by all users of the ASP.NET application. What if a static method is
    > passed an object variable? Do I still need to lock() on that variable for
    > the time the method is manipulating it?
    >
    > Thanks,
    > -Oleg.
    >
    >
    Kevin Spencer, Jun 18, 2004
    #2
    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. Markus Dehmann
    Replies:
    5
    Views:
    2,684
    red floyd
    Jul 1, 2004
  2. Gabriel Rossetti
    Replies:
    0
    Views:
    1,310
    Gabriel Rossetti
    Aug 29, 2008
  3. Raj Singh
    Replies:
    2
    Views:
    194
    Rick DeNatale
    May 29, 2008
  4. Greg Hauptmann
    Replies:
    9
    Views:
    241
    Loren Segal
    Jun 16, 2008
  5. John Nagle
    Replies:
    5
    Views:
    463
    John Nagle
    Mar 12, 2012
Loading...

Share This Page