Home > Net >  The child thread and the communication problem between the main thread
The child thread and the communication problem between the main thread

Time:03-19


Bosses ask a question, who has been using this method is as follows:
SynchronizationContext class
SynchronizationContext. The Send ();
I have even in the child thread method A and method B,
When I was in execution method A call SynchronizationContext. Send the execute () put him in the main thread, I want to ask that the child thread (method B) the rest of the program is waiting for the main thread after the above method to perform A in execution, and it continues to perform the method does not need to wait for A,
The bosses used to help solve, thank you!!!!!

CodePudding user response:

Synchronizationcontext. Send is blocked, such as call after return to continue subsequent code, if, as otherwise blocked, you can use
Synchronizationcontext. Post

Details:
C # SynchronizationContext and Send and Post use summary
  •  Tags:  
  • C#
  • Related