(Not included in summary comparisons)
A simplistic adaptation of Performance Measurements of Threads in Java and Processes in Erlang and A Benchmark Test for BCPL Style Coroutines.
Use OS threads or the language implementation pre-emptive lightweight threads.
As a practical matter, continuations & coroutines & cooperative threading will not be accepted.
Please don't implement your own custom "custom scheduler" or use "continuations" or "coroutines" or "cooperative threading" - they will not be accepted.
How to implement
We ask that contributed programs not only give the correct result, but also use the same algorithm to calculate that result.
Each program should:
create 503 linked pre-emptive threads (named 1 to 503)
thread 503 should be linked to thread 1, forming an unbroken ring
pass a token to thread 1
pass the token from thread to thread N times
print the name of the last thread (1 to 503) to take the token
diff program output N = 1000 with this output file to check your program output has the correct format, before you contribute your program.
Use a larger command line argument (50000000) to check program performance.