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.




      INSTALL @lib$+"TIMERLIB"
 
      tID1% = FN_ontimer(100, PROCtask1, 1)
      tID2% = FN_ontimer(100, PROCtask2, 1)
      tID3% = FN_ontimer(100, PROCtask3, 1)
 
      ON ERROR PRINT REPORT$ : PROCcleanup : END
      ON CLOSE PROCcleanup : QUIT
 
      REPEAT
        WAIT 0
      UNTIL FALSE
      END
 
      DEF PROCtask1
      PRINT "Enjoy"
      ENDPROC
 
      DEF PROCtask2
      PRINT "Rosetta"
      ENDPROC
 
      DEF PROCtask3
      PRINT "Code"
      ENDPROC
 
      DEF PROCcleanup
      PROC_killtimer(tID1%)
      PROC_killtimer(tID2%)
      PROC_killtimer(tID3%)
      ENDPROC