Hi everyone

I'm CC'ing also Alexandre Ferrieux as his opinion on the subject is authoritative.

In the wake of the ticket opened by Anton on core.tcl.tk we are facing the need to change the way we handle child process (prefork MPM) and thread (worker MPM) terminations. We are now recommended to avoid to delete explicitly an interpreter when a child process goes away: it's OK with the prefork bridge (and in the 2.2 module) but there are implications for the threaded model.

With the worker MPM we implement our own exit command which shadows the Tcl core command. This is needed by the sheer existence of the command which I gather eventually calls Tcl_Exit which in turn tears the whole child process down. In a threaded bridge like rivet_worker_mpm you would have all the threads abruptly interrupted just because somewhere in a different thread, likely running a different application, a programmer placed an exit command. Hence our exit code simply tells the thread from where it was called to exit, to notify the supervisor and clean everything to avoid leaks (Tcl interpreter firstly)

If we want homogeneity between the two MPM models we should consider to tell all the threads to gently exit and then let the child process exit as well, I don't see any other sensible approach, even though the overhead of having many threads exit and then restarted just as a side effect of invoking exit is kind of disturbing to me


 -- Massimo


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to