I have the following method :
public List<string> someMethod()
{
// populate list of strings
// dump them to csv file
//return to output
}
Question is: i dont want the user to wait for csv dump, which might take a while.
If i use a thread for csvdump, will it complete? before or after the return of output?
After csvdump is finished, i d like to notify another class to process the csv file.
someMethod doesnt need to wait for csvdump to finish ?
This is an excellent article on C# threading that anyone wanting to know about C# Threading should read.
But for your situation I would do something like this:
If the process is likely to take some time you can get the BackgroundWorker to report it’s progress too.