Created
January 1, 2021 11:57
-
-
Save ierhalim/0e4d0d6acc64630f7628ede28734e0d3 to your computer and use it in GitHub Desktop.
Y6O1 Paralel programlama
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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