On 9/30/2013 2:48 PM, Jim Chen wrote:
So far I looked at the main thread hang monitor [1], but it seems to
make a lot of assumptions about the main thread.
Yes.

  I think it would make
sense to have a separate, generic hang monitor that can monitor
multiple other threads. Each thread would register with the hang
monitor and tell it how much time the thread must be blocked before
it's considered a hang.
The big problem is properly defining what "hung" actually means. For threads which primarily process events, hung pretty much means that the thread is stopped in the middle of processing an event but has never finished. But not all threads are like that. And, you have to be aware of times such as a computer going to sleep when a thread is hung on purpose by the user. But this kind of hang monitoring wouldn't catch a problem if a thread stopped processing events for some other reason. It might also get confused with nested event loops.

The main-thread hang monitor original was designed to crash the app after a prolonged hang, but it turns out that getting sleeping computers right as well as scaling the timeout to slow systems especially at startup was causing false positives. So the hang monitor is currently just used for telemetry collection.

--BDS

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to