Greeting,
Me dunno really how to workout the subject. Basically I already have a threading stuff.
What it do is in Windows Form, when I click a button, a process start (which call a web service, so can imagine the waiting needed). I use threading here as the process take long, so not freeze the form and cursor. When the process done, it will invoke my callback delegate to display the results. Working as expected, no problem.
private void StartJob()
{
ThreadedProcess objTP = new ThreadedProcess();
objTP.StartTranslator(para
meter....,
new Callback_Doing(Doing), new Callback_Done(Done));
objTP = null;
}
public void Doing(...) {...}
public void Done(...) {...}
But now I in another routine, which is generating the results onto a file, so:
Do
{
StartJob();
result grabbed from Done().... *** AAA
Write result into File...
} until all-done;
How do I worked out the -AAA- part?
I reuse the StartJob(), which spin off a thread, but I have to wait for the result grabbed in Done().
Should I lookinto ThreadPool, AutoResetEvent ?
I can't find more details/samples from the MSDN, any good ref would be good for me too.
TQ
Start Free Trial