J
Jozsef Bekes
Hi All,
I am trying to implement a general threading approach in C#, and I have
faced this problem:
I have the function f_main running in thread th1. I want to invoke two
functions f1 and f2 in th_2. From f_main I want to do two distinct function
calls, the first results only in invoking f1 in the context of th_2, the
second function call would invoke only f2 in the context of th_2. f1 and f2
must run in the same thread context.
My approach in C++ would be to start a thread, put the usual while loop with
PeekMessage and DispatchMessage and trigger the function invokations via
PostThreadMessage. I cannot find such an opportunity in C# except for using
the windows API and implementing the stuff as if I was using C++ (that is I
guess not a good approach). Could someone please give me a suggestion how I
should proceed?
Thank you for your help.
Best Regards,
Jozsi
I am trying to implement a general threading approach in C#, and I have
faced this problem:
I have the function f_main running in thread th1. I want to invoke two
functions f1 and f2 in th_2. From f_main I want to do two distinct function
calls, the first results only in invoking f1 in the context of th_2, the
second function call would invoke only f2 in the context of th_2. f1 and f2
must run in the same thread context.
My approach in C++ would be to start a thread, put the usual while loop with
PeekMessage and DispatchMessage and trigger the function invokations via
PostThreadMessage. I cannot find such an opportunity in C# except for using
the windows API and implementing the stuff as if I was using C++ (that is I
guess not a good approach). Could someone please give me a suggestion how I
should proceed?
Thank you for your help.
Best Regards,
Jozsi