Advertisement
Stiepen

Democode of the new KilOS Threading/Processes engine

Mar 2nd, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. -- This is how the output looks: http://imgur.com/KABvNZ2
  2. -- note that the print syscall is only there for debugging purposes
  3.  
  4. function func(name, num)
  5.     for a = 1, num do
  6.         syscall("print", name)
  7.         syscall("yield")
  8.     end
  9. end
  10. syscall("process_create", func, "process1", 2)
  11. syscall("process_create", func, "process2", 3)
  12. syscall("process_create", func, "process3", 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement