{"action":"created","issue":{"url":"https://api.github.com/repos/luvit/luv/issues/133","labels_url":"https://api.github.com/repos/luvit/luv/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/luvit/luv/issues/133/comments","events_url":"https://api.github.com/repos/luvit/luv/issues/133/events","html_url":"https://github.com/luvit/luv/pull/133","id":66157107,"number":133,"title":"add basic thread support","user":{"login":"zhaozg","id":542599,"avatar_url":"https://avatars.githubusercontent.com/u/542599?v=3","gravatar_id":"","url":"https://api.github.com/users/zhaozg","html_url":"https://github.com/zhaozg","followers_url":"https://api.github.com/users/zhaozg/followers","following_url":"https://api.github.com/users/zhaozg/following{/other_user}","gists_url":"https://api.github.com/users/zhaozg/gists{/gist_id}","starred_url":"https://api.github.com/users/zhaozg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhaozg/subscriptions","organizations_url":"https://api.github.com/users/zhaozg/orgs","repos_url":"https://api.github.com/users/zhaozg/repos","events_url":"https://api.github.com/users/zhaozg/events{/privacy}","received_events_url":"https://api.github.com/users/zhaozg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-03T14:34:22Z","updated_at":"2015-04-04T02:12:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/luvit/luv/pulls/133","html_url":"https://github.com/luvit/luv/pull/133","diff_url":"https://github.com/luvit/luv/pull/133.diff","patch_url":"https://github.com/luvit/luv/pull/133.patch"},"body":"Any advice, will with more feature,\r\ncome from uvbook, thread-create.lua\r\n```lua\r\nlocal uv = require('luv')\r\n\r\nlocal hare_id = uv.new_thread()\r\nlocal tortoise_id = uv.new_thread()\r\nlocal step = 10\r\n\r\nuv.thread_create(hare_id,function(step) \r\n    local ffi = require'ffi'\r\n\r\n    local sleep \r\n    if ffi.os=='Windows' then\r\n        ffi.cdef \"void Sleep(int ms);\"\r\n        sleep = ffi.C.Sleep\r\n    else \r\n        ffi.cdef \"unsigned int usleep(unsigned int seconds);\"\r\n        sleep = ffi.C.usleep\r\n    end\r\n    while (step>0) do \r\n        step = step - 1\r\n        sleep(1000)\r\n        print(\"Hare ran another step\")\r\n    end\r\n    print(\"Hare done running!\")\r\nend, step,true,'abcd','false')\r\n\r\nuv.thread_create(tortoise_id,function(step)\r\n    while (step>0) do \r\n        step = step - 0.5\r\n        print(\"Tortoise ran another step\")\r\n    end\r\n    print(\"Tortoise done running!\")\r\nend,step,'abcd','false')\r\n\r\nprint(hare_id==hare_id,uv.thread_equal(hare_id,hare_id))\r\nprint(tortoise_id==hare_id,uv.thread_equal(tortoise_id,hare_id))\r\n\r\nuv.thread_join(hare_id)\r\nuv.thread_join(tortoise_id)\r\n```"},"comment":{"url":"https://api.github.com/repos/luvit/luv/issues/comments/89483417","html_url":"https://github.com/luvit/luv/pull/133#issuecomment-89483417","issue_url":"https://api.github.com/repos/luvit/luv/issues/133","id":89483417,"user":{"login":"zhaozg","id":542599,"avatar_url":"https://avatars.githubusercontent.com/u/542599?v=3","gravatar_id":"","url":"https://api.github.com/users/zhaozg","html_url":"https://github.com/zhaozg","followers_url":"https://api.github.com/users/zhaozg/followers","following_url":"https://api.github.com/users/zhaozg/following{/other_user}","gists_url":"https://api.github.com/users/zhaozg/gists{/gist_id}","starred_url":"https://api.github.com/users/zhaozg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhaozg/subscriptions","organizations_url":"https://api.github.com/users/zhaozg/orgs","repos_url":"https://api.github.com/users/zhaozg/repos","events_url":"https://api.github.com/users/zhaozg/events{/privacy}","received_events_url":"https://api.github.com/users/zhaozg/received_events","type":"User","site_admin":false},"created_at":"2015-04-04T02:12:56Z","updated_at":"2015-04-04T02:12:56Z","body":"It hard work to make lua script  as work_cb and after_work_cb. serial callback code everytime will a lots of CPU time"}}