{"action":"created","issue":{"url":"https://api.github.com/repos/servo/servo/issues/7450","labels_url":"https://api.github.com/repos/servo/servo/issues/7450/labels{/name}","comments_url":"https://api.github.com/repos/servo/servo/issues/7450/comments","events_url":"https://api.github.com/repos/servo/servo/issues/7450/events","html_url":"https://github.com/servo/servo/pull/7450","id":103891012,"number":7450,"title":"Ordering guarantees for timers","user":{"login":"benschulz","id":10342420,"avatar_url":"https://avatars.githubusercontent.com/u/10342420?v=3","gravatar_id":"","url":"https://api.github.com/users/benschulz","html_url":"https://github.com/benschulz","followers_url":"https://api.github.com/users/benschulz/followers","following_url":"https://api.github.com/users/benschulz/following{/other_user}","gists_url":"https://api.github.com/users/benschulz/gists{/gist_id}","starred_url":"https://api.github.com/users/benschulz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benschulz/subscriptions","organizations_url":"https://api.github.com/users/benschulz/orgs","repos_url":"https://api.github.com/users/benschulz/repos","events_url":"https://api.github.com/users/benschulz/events{/privacy}","received_events_url":"https://api.github.com/users/benschulz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/servo/servo/labels/S-awaiting-review","name":"S-awaiting-review","color":"d4c5f9"},{"url":"https://api.github.com/repos/servo/servo/labels/S-needs-rebase","name":"S-needs-rebase","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"jdm","id":27658,"avatar_url":"https://avatars.githubusercontent.com/u/27658?v=3","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false},"milestone":null,"comments":12,"created_at":"2015-08-30T00:18:31Z","updated_at":"2015-09-27T14:51:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/7450","html_url":"https://github.com/servo/servo/pull/7450","diff_url":"https://github.com/servo/servo/pull/7450.diff","patch_url":"https://github.com/servo/servo/pull/7450.patch"},"body":"This is an rough solution to the issue described in #3396. XHRs still do their own thing and an overall clean up is in order. Before I do that, though, I'd really like someone to sign off on the overall idea.\r\n\r\nThere's one major difference to what jdm layed out #3396: The timers remain with the window/worker and only the earliest expiring one is coordinated with the dedicated timer thread.\r\nThat means both the timer thread and the window/worker have to keep track of which timer expires next, which feels a bit wonky. However, the upshot is that there's no need for communication with the timer thread when a pipeline is frozen, thawed or dropped.\r\n\r\nMost relvant parts are\r\n - the [`TimerScheduler`](https://github.com/servo/servo/commit/6f5f6619586379982321b5de7583d387df184504#diff-74137a6f50ab38e7a1e4d16920a66ce7R73), which is the new per-constellation timer task and\r\n - the [`ActiveTimers`](https://github.com/servo/servo/commit/6f5f6619586379982321b5de7583d387df184504#diff-86707d952414a2860b78bcf6c1db8e2eR34) which is what's left on the window/worker side.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/servo/servo/7450)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/servo/servo/issues/comments/143563876","html_url":"https://github.com/servo/servo/pull/7450#issuecomment-143563876","issue_url":"https://api.github.com/repos/servo/servo/issues/7450","id":143563876,"user":{"login":"benschulz","id":10342420,"avatar_url":"https://avatars.githubusercontent.com/u/10342420?v=3","gravatar_id":"","url":"https://api.github.com/users/benschulz","html_url":"https://github.com/benschulz","followers_url":"https://api.github.com/users/benschulz/followers","following_url":"https://api.github.com/users/benschulz/following{/other_user}","gists_url":"https://api.github.com/users/benschulz/gists{/gist_id}","starred_url":"https://api.github.com/users/benschulz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benschulz/subscriptions","organizations_url":"https://api.github.com/users/benschulz/orgs","repos_url":"https://api.github.com/users/benschulz/repos","events_url":"https://api.github.com/users/benschulz/events{/privacy}","received_events_url":"https://api.github.com/users/benschulz/received_events","type":"User","site_admin":false},"created_at":"2015-09-27T14:51:02Z","updated_at":"2015-09-27T14:51:02Z","body":"\n\n\n\nReview status: 10 of 19 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed.\n\n---\n\n<sup>**[components/script/timers.rs, line 142 \\[r1\\]](https://reviewable.io:443/reviews/servo/servo/7450#-JzpPZw35GNseeaL-uUX)** ([raw file](https://github.com/servo/servo/blob/6f5f6619586379982321b5de7583d387df184504/components/script/timers.rs#L142)):</sup>\nDone.\n\n---\n\n<sup>**[components/script_traits/lib.rs, line 214 \\[r11\\]](https://reviewable.io:443/reviews/servo/servo/7450#-K-EGArcXaueaVHDVNKY)** ([raw file](https://github.com/servo/servo/blob/169df3634c878adb7f94d2a84891ffc26a108a60/components/script_traits/lib.rs#L214)):</sup>\nSorry, I was too trigger-happy. I need a `precise_time_ns` version to make sure that the time between `set_timeout_or_interval` and the callback invocation is at least `timeout` ms.\n\n---\n\n<sup>**[components/util/mem.rs, line 209 \\[r9\\]](https://reviewable.io:443/reviews/servo/servo/7450#-K-EBr8E92HousETnDlW)** ([raw file](https://github.com/servo/servo/blob/5ba0e0ed16857322130cd575f46ab0aee10720b2/components/util/mem.rs#L209)):</sup>\nI don't feel too good about this. Should I switch to sorted vectors and get rid of the BinaryHeap impls for HeapSizeOf and JSTraceable?\n\n---\n\n\nComments from the [review on Reviewable.io](https://reviewable.io:443/reviews/servo/servo/7450)\n<!-- Sent from Reviewable.io -->\n"}}