fork(2) download
  1. class test
  2. a = nil
  3. c1 = 0
  4. c2 = 1
  5. end
  6.  
  7. loops = 1000000
  8.  
  9. function changeAsInt(t)
  10. > "Entering changeAsInt"
  11. for i = 0 to loops
  12. t.a = i
  13. t.c1 = i
  14. end
  15. end
  16.  
  17. function changeAsString(t)
  18. > "Entering changeAsString"
  19. for i = 0 to loops
  20. t.a = "String " + i
  21. t.c2 = i
  22. end
  23. end
  24.  
  25.  
  26. function checker( t )
  27. > "Entering checker"
  28. > ""
  29. while t.c1 < loops or t.c2 < loops
  30. >> "Check: ", t.c1, " - ", t.c2, ": ", t.a, " ", "\r"
  31. end
  32. end
  33.  
  34. t = test()
  35. comp = Parallel( {=>changeAsInt(t)}, {=> changeAsString(t)}, {=> checker(t)})
  36. comp.launch()
  37. > ""
  38. > "Complete."
  39.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty