G
Guest
I was told .net uses ThreadPool to manage the threads generated by the
asynchronous methods automaticly, I had written a program with C# such as
In MainMethod
……
…….BeginInvoke(new AsyncCallback(Method1CallBack), null);
……
In Method1CallBack:
……
…….BeginInvoke(new AsynCallback(Method2CallBack),null);
……
In Method2CallBack:
……
DoSomething;
……
a series of asynchronous methods were invoked one by one, I made several
threads invoke the MainMethod, thus there were many asynchronous threads,but
the whole process is automatic controled by the system, how can i control the
whole process, such as teminate some of these asynchronous threads or restart
them,should i set several switches to prevent the continuing executions in
the beginning of each asychronous method?
asynchronous methods automaticly, I had written a program with C# such as
In MainMethod
……
…….BeginInvoke(new AsyncCallback(Method1CallBack), null);
……
In Method1CallBack:
……
…….BeginInvoke(new AsynCallback(Method2CallBack),null);
……
In Method2CallBack:
……
DoSomething;
……
a series of asynchronous methods were invoked one by one, I made several
threads invoke the MainMethod, thus there were many asynchronous threads,but
the whole process is automatic controled by the system, how can i control the
whole process, such as teminate some of these asynchronous threads or restart
them,should i set several switches to prevent the continuing executions in
the beginning of each asychronous method?