{"action":"created","issue":{"url":"https://api.github.com/repos/IRkernel/IRkernel/issues/164","labels_url":"https://api.github.com/repos/IRkernel/IRkernel/issues/164/labels{/name}","comments_url":"https://api.github.com/repos/IRkernel/IRkernel/issues/164/comments","events_url":"https://api.github.com/repos/IRkernel/IRkernel/issues/164/events","html_url":"https://github.com/IRkernel/IRkernel/issues/164","id":92691982,"number":164,"title":"need a separate heartbeat thread?","user":{"login":"stevengj","id":2913679,"avatar_url":"https://avatars.githubusercontent.com/u/2913679?v=3","gravatar_id":"","url":"https://api.github.com/users/stevengj","html_url":"https://github.com/stevengj","followers_url":"https://api.github.com/users/stevengj/followers","following_url":"https://api.github.com/users/stevengj/following{/other_user}","gists_url":"https://api.github.com/users/stevengj/gists{/gist_id}","starred_url":"https://api.github.com/users/stevengj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevengj/subscriptions","organizations_url":"https://api.github.com/users/stevengj/orgs","repos_url":"https://api.github.com/users/stevengj/repos","events_url":"https://api.github.com/users/stevengj/events{/privacy}","received_events_url":"https://api.github.com/users/stevengj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-02T17:36:17Z","updated_at":"2016-01-25T20:28:01Z","closed_at":null,"body":"I noticed that you seem to be implementing your heartbeat response in the same event loop that processes other events.   This is a problem, because if you have a long-running computation it will take too long to respond to a heartbeat request and Jupyter will think that the kernel has died.\r\n\r\nWe had the same problem initially in Julia (JuliaLang/IJulia.jl#8) and solved it by spawning a real OS thread to respond to the heartbeats.  I don't know if you can do this natively in R, but if not it just involves writing a one-line C function that calls `zmq_device` and then blocks forever, which you then pass to `pthread_create` or the Windows equivalent."},"comment":{"url":"https://api.github.com/repos/IRkernel/IRkernel/issues/comments/174651795","html_url":"https://github.com/IRkernel/IRkernel/issues/164#issuecomment-174651795","issue_url":"https://api.github.com/repos/IRkernel/IRkernel/issues/164","id":174651795,"user":{"login":"flying-sheep","id":291575,"avatar_url":"https://avatars.githubusercontent.com/u/291575?v=3","gravatar_id":"","url":"https://api.github.com/users/flying-sheep","html_url":"https://github.com/flying-sheep","followers_url":"https://api.github.com/users/flying-sheep/followers","following_url":"https://api.github.com/users/flying-sheep/following{/other_user}","gists_url":"https://api.github.com/users/flying-sheep/gists{/gist_id}","starred_url":"https://api.github.com/users/flying-sheep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flying-sheep/subscriptions","organizations_url":"https://api.github.com/users/flying-sheep/orgs","repos_url":"https://api.github.com/users/flying-sheep/repos","events_url":"https://api.github.com/users/flying-sheep/events{/privacy}","received_events_url":"https://api.github.com/users/flying-sheep/received_events","type":"User","site_admin":false},"created_at":"2016-01-25T20:28:01Z","updated_at":"2016-01-25T20:28:01Z","body":"@takluyver did that happen already?"}}