See Threads That Javascript Is Creating?
Solution 1:
JavaScript doesn't make threads. The underlying browser might be handling events in its own threaded environment, and then causing your JavaScript interpreter to run the handlers, but there is no thread access in JavaScript, and how the browser works is implementation specific.
Solution 2:
JavaScript does not create new threads, it runs in the browser. You can't really see this information. you can use a profiler but i'm not sure that answers your question
Solution 3:
Use this tool and see if it achieves what you want: Visual Event
Solution 4:
JavaScript is "single-threaded", all execution is linear (although we don't know how the underlying engine works).
Asynchronous actions are event-based (DOM events, Ajax calls, WebWorkers), so the execution of their handlers is appended to a scheduler queue - they will only execute when the current execution has finished. That is why infinite loops can't be stopped from outside - they will just freeze the browser (and eventually throw a long-running script
exception).
It's the same with timeouts (W3 Timer
spec), they add a task on the list of active timers. You can read more on such task queues in the processing model spec for Web-App APIs.
Post a Comment for "See Threads That Javascript Is Creating?"