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.




' Concurrent computing using the OpenMP extension in GCC. Requires BaCon 3.6 or higher.
 
' Specify compiler flag
PRAGMA OPTIONS -fopenmp
 
' Sepcify linker flag
PRAGMA LDFLAGS -lgomp
 
' Declare array with text
DECLARE str$[] = { "Enjoy", "Rosetta", "Code" }
 
' Indicate MP optimization for FOR loop
PRAGMA omp parallel for num_threads(3)
 
' The actual FOR loop
FOR i = 0 TO 2
    PRINT str$[i]
NEXT
 