Hi George
I will create the proposal for the GSoC tomorrow night. If you examine
my message you'll find that my idea is to create through APR a pool of
threads, each of them having their own Tcl intepreter. A thread will
hold its intepreter and never yield it to any other execution thread. I
don't know yet what policy has to be followed to manage this pool of
threads, but this is part of the project goals. I don't know if it's
going to work and I don't know if this answers your objection.
If possible next week I will prepare a proof of concept program: an APR
based program where a pool of threads are started and each of them will
create their own Tcl interpreter and then wait on a queue for some job
to do. The controlling thread should send Tcl scripts to the queue and
the waiting threads pick the scripts and execute them. The data
structure passed to the queue should emulate the role of a request_rec
pointer.
On 01-03-2014 17:04, Georgios Petasis wrote:
I am afraid this in not going to work at. Tcl's thread model can
never allow an interpreter to be used by
any other thread except the one it has created it. This is a design
choice of Tcl (the "apartment" model).
The only work-arround is to create an interpreter when an apache
thread starts (and terminate when it finishes).
I considered also this option, but at that time apache didn't have
hooks when a thread is started/terminated, so rivet will have no idea
about threads.
I hope these hooks now exist. If they do, it will be really easy...
Regards,
George
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
For additional commands, e-mail: rivet-dev-h...@tcl.apache.org