I create streams that join the server from multiple accounts. They work, everything is fine. But they, as it were, uncontrollable. If I want to send or do something in a particular stream, then it puts me in a stupor. I can not understand how to access the workflow, while sending him a method.
This is how I create threads:
public void thrd() { thread = new Thread[100]; for (int i = 0; i < Global.countthread; i++) { thread[i] = new Thread(this.Checking); thread[i].IsBackground = true; thread[i].Start(); } }
Task? - VladDSynchronizationContext.Send(synchronously) orSynchronizationContext.Post(asynchronously), and you need to have a link to theSynchronizationContextUI stream, which can be obtained, for example, in the form designer, or whatever you have . - Raider