Advertisement
bueddl

Untitled

Sep 17th, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. dofile("core")
  2.  
  3. local sock = socket_create(AF_INET, SOCK_DGRAM, 0)
  4. socket_bind(sock, 1234)
  5.  
  6. local function target_worker()
  7.     for i=1,20 do
  8.         print('target_worker (' .. tostring(pid()) .. ')')
  9.         local buffer = socket_recv(sock)
  10.         sleep(5)
  11.     end
  12. end
  13.  
  14. local function target_scheduler()
  15.     for i=1,10 do
  16.         print('target_scheduler')
  17.         process_create(target_worker)
  18.         sleep(1)
  19.     end
  20. end
  21.  
  22. process_create(target_scheduler)
  23. sched()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement