Re: How to trigger other thread

Tech-Archive recommends: Fix windows errors by optimizing your registry



Jon,

I can't get through to your website, but would like to see your solution.
Is your site down, or is the problem at my end?

I was assuming that there are only two threads in the application.
Obviously, if there are other threads, they will not be able to see the
variable if it is not static.

David


"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1d4b34744d17f6a98c4e8@xxxxxxxxxxxxxxxxxxxxxxx
> Axel Dahmen <NO_SPAM@xxxxxxxxxxxxxxxxxx> wrote:
>> I've two threads in my program: 1) The original program thread and 2) a
>> worker thread.
>>
>> For simplicity my worker thread writes its output into the static
>> controls
>> and status bar by itself.
>
> <snip>
>
> It looks like your solution - at that provided by aualias - aren't
> thread-safe. They assume that when one thread changes the value of a
> variable, all other threads see that value change.
>
> See http://www.pobox.com/~skeet/csharp/threads/volatility.shtml for why
> that's a bad assumption, and
> http://www.pobox.com/~skeet/csharp/threads/shutdown.shtml for a cleaner
> way to shut down a thread.
>
> --
> Jon Skeet - <skeet@xxxxxxxxx>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too


.



Relevant Pages

  • How to trigger other thread
    ... I've two threads in my program: 1) The original program thread and 2) a ... For simplicity my worker thread writes its output into the static controls ... updating a status bar panel. ... It appears to me that updating the status bar ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: How to trigger other thread
    ... > For simplicity my worker thread writes its output into the static controls ... > and status bar by itself. ... They assume that when one thread changes the value of a ...
    (microsoft.public.dotnet.framework.windowsforms)