fork download
  1. #include <stdio.h>
  2. #include <unistd.h>
  3.  
  4. int main() {
  5. int total_threads = 8
  6. ;
  7. int current;
  8.  
  9. for (current = 0; current < total_threads; current++) {
  10. usleep(150000);
  11. printf("Ordered hello %d of %d\n", current, total_threads);
  12. }
  13.  
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5328KB
stdin
Standard input is empty
stdout
Ordered hello 0 of 8
Ordered hello 1 of 8
Ordered hello 2 of 8
Ordered hello 3 of 8
Ordered hello 4 of 8
Ordered hello 5 of 8
Ordered hello 6 of 8
Ordered hello 7 of 8