Well Chris,
you got it exactly. But it sounds not very good, to use active wait (for
polling a flag)!!! (especially not in a resource constrained device). The
"not managed" NamedEvent-Objects in turn block my receiving thread, so it
could do no other work!!!! (although the thread would enter an efficient
wait state!)
Maybe I should resort to a little dirty trick -
what would happen if I used the Control.Invoke to call a delegate from the
gui thread to execute my method for me?!?!?
The gui thread in turn doesn't really need to update the form but can do
other work i intend for it. Am i right or is this wrong!?
As I think, thr only pity would be I had to keep a reference on a gui object
in my object when needing to Control.Invoke!?
regards
Chris
"Chris Tacke, eMVP" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> So you want this?
>
> You have 2 threads, A and B.
>
> You want Thread B to be able to run a mthod in Thread A's context?
>
> The only way to do that is to have Thread A listening for an event (not a
> managed event, that's in the caller's context) or monitoring some global
> flag that when set by Thread B tells it to call the desired method.
>
> --
> Chris Tacke
> Co-founder
> OpenNETCF.org
> Has OpenNETCF helped you? Consider donating to support us!
> http://www.opennetcf.org/donate
>
>
> "Chris" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hello there,
>>
>> Can I invoke a method on a foreign thread from within a continually
>> running worker thread? The method called should be executed by the
>> foreign thread and in the foreign thread's context!
>> The method is NOT associated with a certain control or Form object, it is
>> simply a different thread running.
>> In principle, it would be sufficient to send a notification to a
>> different thread!!!!
>> Please don't tell me how to invoke methods with Control.Invoke, I already
>> know that.;-)
>> Anyway, I'm very thankful if someone knew-
>> regards
>> Chris
>>
>>
>
>