{"action":"created","issue":{"url":"https://api.github.com/repos/dabeaz/curio/issues/127","repository_url":"https://api.github.com/repos/dabeaz/curio","labels_url":"https://api.github.com/repos/dabeaz/curio/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/dabeaz/curio/issues/127/comments","events_url":"https://api.github.com/repos/dabeaz/curio/issues/127/events","html_url":"https://github.com/dabeaz/curio/pull/127","id":191234742,"number":127,"title":"Switch to fully batched scheduling & add blocking task warning","user":{"login":"njsmith","id":609896,"avatar_url":"https://avatars.githubusercontent.com/u/609896?v=3","gravatar_id":"","url":"https://api.github.com/users/njsmith","html_url":"https://github.com/njsmith","followers_url":"https://api.github.com/users/njsmith/followers","following_url":"https://api.github.com/users/njsmith/following{/other_user}","gists_url":"https://api.github.com/users/njsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/njsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njsmith/subscriptions","organizations_url":"https://api.github.com/users/njsmith/orgs","repos_url":"https://api.github.com/users/njsmith/repos","events_url":"https://api.github.com/users/njsmith/events{/privacy}","received_events_url":"https://api.github.com/users/njsmith/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-23T10:31:20Z","updated_at":"2016-11-23T16:05:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dabeaz/curio/pulls/127","html_url":"https://github.com/dabeaz/curio/pull/127","diff_url":"https://github.com/dabeaz/curio/pull/127.diff","patch_url":"https://github.com/dabeaz/curio/pull/127.patch"},"body":"This PR makes curio's scheduling proceed in strict batches: each batch\nstarts with polling for I/O, and if a task becomes runnable now, it won't\nactually run until the next batch. Basically this gives us the invariant\nthat no single task can be scheduled twice without checking for I/O in\nbetween.\n\nThis prevents various obscure pathologies (see gh-112), and brings us in\nline with how most (all?) other event loops work; see for example:\n  http://docs.libuv.org/en/v1.x/design.html#the-i-o-loop\n\nIt also adds a warning if any individual task blocks the event loop\nfor more than 50 ms. This value is pretty arbitrary, but at least it's\na start. Combined with the above change, this should at least be\nsufficient to detect any gratuitous starvation issues."},"comment":{"url":"https://api.github.com/repos/dabeaz/curio/issues/comments/262556995","html_url":"https://github.com/dabeaz/curio/pull/127#issuecomment-262556995","issue_url":"https://api.github.com/repos/dabeaz/curio/issues/127","id":262556995,"user":{"login":"dabeaz","id":350836,"avatar_url":"https://avatars.githubusercontent.com/u/350836?v=3","gravatar_id":"","url":"https://api.github.com/users/dabeaz","html_url":"https://github.com/dabeaz","followers_url":"https://api.github.com/users/dabeaz/followers","following_url":"https://api.github.com/users/dabeaz/following{/other_user}","gists_url":"https://api.github.com/users/dabeaz/gists{/gist_id}","starred_url":"https://api.github.com/users/dabeaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dabeaz/subscriptions","organizations_url":"https://api.github.com/users/dabeaz/orgs","repos_url":"https://api.github.com/users/dabeaz/repos","events_url":"https://api.github.com/users/dabeaz/events{/privacy}","received_events_url":"https://api.github.com/users/dabeaz/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T16:05:00Z","updated_at":"2016-11-23T16:05:00Z","body":"Looking at asyncio, it appears to be doing some kind of batching similar to what's seen in this PR.  The implementation is a bit simpler.   It simply computes the length of the ready queue when it starts scheduling and only schedules that many tasks--regardless of whether or not more tasks get added to the queue in the process.   I think I like that better (you don't need to manage two separate queue objects).\r\n\r\nasyncio also includes some code to check for slow callbacks using timers.  However, that code is only enabled if it's running in debug mode. "}}
{"actor":{"display_login":"dabeaz"}}