lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Rena once stated:
> 
> It still seems like there's an issue though. If I let the child threads
> keep running after the main thread exits, they don't shut down correctly. I
> have extensive debug output logging what each thread is doing, and after
> the main thread's destructor fires, some child threads just stop abruptly
> (sometimes in the middle of writing a line). If I don't explicitly load my
> module in each child thread, then they'll even segfault. (Maybe trying to
> access some code in that module after it's been unloaded?) Is there
> something else I have to do to allow child threads to keep running after
> the main thread finishes?

  Keep the main thread around until all the children finish.

  The main thread *is* the process.  When that is done, so is the process.

  -spc