C#.Rihter.ContinueWith
static void Main(string[] args) { Task<int> t = new Task<int>(Work); t.Start(); Thread.Sleep(3000); // doing smth in main thread t.ContinueWith(t => Console.WriteLine(«job is done «
static void Main(string[] args) { Task<int> t = new Task<int>(Work); t.Start(); Thread.Sleep(3000); // doing smth in main thread t.ContinueWith(t => Console.WriteLine(«job is done «
task allows get result
static void Main(string[] args) { Task<int> t = new Task<int>(n => Sum((int) n), 10000); t.Start(); t.Wait(); Console.WriteLine(«The sum is «