Running Apache and Rivet from the debugger might help to grasp what's
going on, but I think I have to read some other module's code in order
to understand.
In principle one has to design a module so that it's mpm agnostic as
much as possible (Nick Kew's words). By this rule I understand that a
module itself shouldn't be bothered creating and managing threads and
it shouldn't do assumptions about the environment where it runs. In
other words one has to keep in mind that code could be either running in
one of many threads or be the only thread of a child server, whence the
second general rule I found explicitly stated: global data must be
always accessed after a lock on a specific (APR) Mutex has been gained.
Otherwise said: if you don't know your whereabouts assume you're in a
thread.
Tcl's threading shouldn't be involved here: in this model Apache has the
duty of managing threads. Interpreters within a thread will be real
independent interpreters without any chance to communicate through the
mechanisms Tcl's Threads provide.
I expect the mpm worker to use some hook to initialize a thread in a
similar way it does for a child process (perhaps the same hook is called
for each process and thread alike). In this scheme Rivet would end up
creating a potentially large number of interpreters:
num_of_children * number_of_virtual_hosts * number_of_threads_per_child
That makes Karl's concerns about interpreters proliferation more
dramatic....
-- Massimo
On 07/29/2011 08:40 PM, Karl Lehenbauer wrote:
I know Tcl's thread model is one interpreter per thread. That seems like
a pretty good fit. Is it even relevant?
On 7/29/11 1:16 PM, "Damon Courtney"<da...@tclhome.com> wrote:
I don't recall being the one to addd that code, but I would imagine we
need to go with Apache's model here. We run inside Apache's world, for
the most part, so we should let that be the record of authority in cases
like these.
Damon
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
For additional commands, e-mail: rivet-dev-h...@tcl.apache.org