View Single Post
Unread 12-04-12, 06:32 PM   #37
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,060
A coroutine represents a thread, but isn't a real one. If you have a coroutine run an infinite loop in the game client, it'll freeze it the same way as if you had code in the main stack do so. This is because the coroutine needs to yield in order for the main stack to continue running. If it never yields, the thread it's running on (the only thread the Lua engine is given) gets stuck. Since MoP though, the game client has a WatchDog thread that activates while in combat and monitors how long the Lua engine thread runs. If the Lua thread exceeds a specific amount of time, the WatchDog thread interrupts it by forcing a Lua error.

Note WatchDog is an old term for a program or circuit specifically designed to detect when another critical program/component freezes and restarts it as necessary.
__________________
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 12-04-12 at 06:36 PM.
SDPhantom is offline   Reply With Quote