Skip to content

Instantly share code, notes, and snippets.

@ierhalim
Created January 1, 2021 11:57
Show Gist options
  • Select an option

  • Save ierhalim/0e4d0d6acc64630f7628ede28734e0d3 to your computer and use it in GitHub Desktop.

Select an option

Save ierhalim/0e4d0d6acc64630f7628ede28734e0d3 to your computer and use it in GitHub Desktop.
Y6O1 Paralel programlama
using System;
using System.Threading.Tasks;
namespace ContinueWithExample
{
class Program
{
static void Main(string[] args)
{
var task1 = Task.Run(() => {
Console.WriteLine("Task 1 running");
return "Task 1 result";
});
var task2 = task1.ContinueWith((completedTask) => {
Console.WriteLine("Task 1 completed, the result is:{0}", completedTask.Result);
});
// task2 nin başlaması için task1 in tamamlanması gerekiyor, bu yüzden task2 nin tamamlanmasını beklemek yeterli.
task2.Wait();
Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment