Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Async Multithreading
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; namespace Rextester { class Program { public static async Task Foo(int num) { Console.WriteLine("Thread {0} - Start {1}", Thread.CurrentThread.ManagedThreadId, num); await Task.Delay(1000); Console.WriteLine("Thread {0} - End {1}", Thread.CurrentThread.ManagedThreadId, num); } public static List<Task> TaskList = new List<Task>(); public static void Main(string[] args) { for (int i = 0; i < 3; i++) { int idx = i; TaskList.Add(Foo(idx)); } Task.WaitAll(TaskList.ToArray()); Console.WriteLine("Press Enter to exit..."); Console.ReadLine(); } } }
run
|
edit
|
history
|
help
0
Problem Name: single_digit
Bubble Sort
sdfrgthyjui65trfvf
Math 5.83b
if else y var
Gerador de Matriz Data
Immutable
starpattern
asdfghjujytgrf
jkloikujyt5r4e3wsxdf