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.




procedure echo(sequence s)
    puts(1,s)
    puts(1,'\n')
end procedure
 
atom task1,task2,task3
 
task1 = task_create(routine_id("echo"),{"Enjoy"})
task_schedule(task1,1)
 
task2 = task_create(routine_id("echo"),{"Rosetta"})
task_schedule(task2,1)
 
task3 = task_create(routine_id("echo"),{"Code"})
task_schedule(task3,1)
 
task_yield()