// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Threading; class MainClass { public static void Main(string[] args) { Thread[] t = new Thread[10]; for(int i = 0; i < t.Length; i++) { t[i] = new Thread(new ThreadStart(DoSomething)); } for(int i = 0; i < t.Length; i++) { t[i].Start(); } for(int i = 0; i < t.Length; i++) { t[i].Join(); } } public static void DoSomething() { Console.WriteLine("start"); Thread.Sleep(5000); Console.WriteLine("end"); } }