title: Multi-threaded Event Dispatching
body: <p>I am developing a C++ application that will use Lua scripts for external add-ons. The add-ons are entirely event-driven; handlers are registered with the host application when the script is loaded, and the host calls the handlers as the events occur.</p>
  
  <p>What I want to do is to have each Lua script running in its own thread, to prevent scripts from locking up the host application. My current intention is to spin off a new thread to execute the Lua code, and allow the thread to terminate on its own once the code has completed. <strong>What are the potential pitfalls of spinning off a new thread as a form of multi-threaded event dispatching?</strong></p>