Task

Using either native language concurrency syntax or freely available libraries, write a program to display the strings "Enjoy" "Rosetta" "Code", one string per line, in random order.

Concurrency syntax must use threads, tasks, co-routines, or whatever concurrency is called in your language.




 
static Random tRand = new Random();
 
static void Main(string[] args)
{
	Thread t = new Thread(new ParameterizedThreadStart(WriteText));
	t.Start("Enjoy");
 
	t = new Thread(new ParameterizedThreadStart(WriteText));
	t.Start("Rosetta");
 
	t = new Thread(new ParameterizedThreadStart(WriteText));
	t.Start("Code");
 
	Console.ReadLine();
}
 
private static void WriteText(object p)
{
	Thread.Sleep(tRand.Next(1000, 4000));
	Console.WriteLine(p);
}
 