{"action":"created","issue":{"url":"https://api.github.com/repos/libuv/libuv/issues/446","labels_url":"https://api.github.com/repos/libuv/libuv/issues/446/labels{/name}","comments_url":"https://api.github.com/repos/libuv/libuv/issues/446/comments","events_url":"https://api.github.com/repos/libuv/libuv/issues/446/events","html_url":"https://github.com/libuv/libuv/issues/446","id":95913196,"number":446,"title":"[RFC]threadpool: send notify signal to consumer only when queue is empty","user":{"login":"chenttuuvv","id":5310240,"avatar_url":"https://avatars.githubusercontent.com/u/5310240?v=3","gravatar_id":"","url":"https://api.github.com/users/chenttuuvv","html_url":"https://github.com/chenttuuvv","followers_url":"https://api.github.com/users/chenttuuvv/followers","following_url":"https://api.github.com/users/chenttuuvv/following{/other_user}","gists_url":"https://api.github.com/users/chenttuuvv/gists{/gist_id}","starred_url":"https://api.github.com/users/chenttuuvv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenttuuvv/subscriptions","organizations_url":"https://api.github.com/users/chenttuuvv/orgs","repos_url":"https://api.github.com/users/chenttuuvv/repos","events_url":"https://api.github.com/users/chenttuuvv/events{/privacy}","received_events_url":"https://api.github.com/users/chenttuuvv/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-19T12:38:44Z","updated_at":"2015-07-20T08:30:03Z","closed_at":"2015-07-20T08:00:03Z","body":"In one of our server box, we notice that large amounts of cpu were consumed by libc function pthread_signal, which can be back traced to post()@threadpool.c. In order to make the producer/consumer implementation more symmetric, should we only send pthread signal to cosumer only when queue is empty? If yes, please let me send a PR."},"comment":{"url":"https://api.github.com/repos/libuv/libuv/issues/comments/122812759","html_url":"https://github.com/libuv/libuv/issues/446#issuecomment-122812759","issue_url":"https://api.github.com/repos/libuv/libuv/issues/446","id":122812759,"user":{"login":"chenttuuvv","id":5310240,"avatar_url":"https://avatars.githubusercontent.com/u/5310240?v=3","gravatar_id":"","url":"https://api.github.com/users/chenttuuvv","html_url":"https://github.com/chenttuuvv","followers_url":"https://api.github.com/users/chenttuuvv/followers","following_url":"https://api.github.com/users/chenttuuvv/following{/other_user}","gists_url":"https://api.github.com/users/chenttuuvv/gists{/gist_id}","starred_url":"https://api.github.com/users/chenttuuvv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenttuuvv/subscriptions","organizations_url":"https://api.github.com/users/chenttuuvv/orgs","repos_url":"https://api.github.com/users/chenttuuvv/repos","events_url":"https://api.github.com/users/chenttuuvv/events{/privacy}","received_events_url":"https://api.github.com/users/chenttuuvv/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T08:30:03Z","updated_at":"2015-07-20T08:30:03Z","body":"worker wait for signal only when queue is empty, this mean we should send signal to them only when queue is empty, otherwise cpu cycle is wasted. Why this whould not work?"}}