Re: Multi-Threading Question

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote:

> That's certainly true. However, if the local variable is a reference to
> an object which is also being used and potentially changed on another
> thread, you need to use locks, volatile variables or explicit memory
> barriers to ensure safety.

In this case it's never being changed, although it is being used on another
thread.

Will the locking I'm already doing suffice here?
.



Relevant Pages

  • Re: Multi-Threading Question
    ... if the local variable is a reference to ... > Will the locking I'm already doing suffice here? ... By the time you release the lock in thread A, ...
    (microsoft.public.dotnet.framework)
  • cvs-src summary for June 7-14
    ... Here's the summary - hope you like locking. ... You can get old summaries, and an HTML version of this one, at ... Poul-Henning Kamp committed reference counting for the tty code; ...
    (freebsd-current)
  • Re: Threads - why isnt a whole object locked when ...?
    ... All of your questions are answerable by pointing out that you have an incorrect mental model of what it means to "lock" something. ... That is, while it's entirely sensible to people who are familiar with standard thread synchronization techniques, in reality it's not actually locking anything. ... Instead, it's using the reference as a sort of traffic signal for other threads, which are cooperating, to respect. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Web Methods Lock
    ... > first user or will both be able to run the web method? ... > web service handle this? ... Is there any good reference available. ... Prev by Date: ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: multi threading in C#
    ... guarantees that no-one else can screw things up by locking on it ... reference example, "listLock" is the reference only you have access to, and the implication is that "queue" is a reference that others have access to. ...
    (microsoft.public.dotnet.languages.csharp)