Like in your case it's not working for me also. I'm afraid the answer should be searched in the docs or even the code in the way the event queue and other subsystems are prepared by the shell. After all tclsh (and likewise wish) are more the programs wrapping the interpreter for the command line in the way we do within mod_rivet.

I have a workaround that uses Tcl threads and it works for me and I'm confident it could work for you provided your rivet build was done with a threaded Tcl library.

Here is my proof of concept: a pool of 10 threads (you probably don't need that many) is started and then sits waiting for some task to be signaled through the ::thread::send call. Then the 'signal_threads' procedure is called and each thread is requested to run the procedure passed as second argument (my example simply sent a procedure that let a thread wait for a random interval thus emulating different tasks taking different times for their execution). I posted this procedure months ago to clarify that in principle mpm_prefork doesn't imply you can't use Tcl threads.

I added your synchronous code and it worked. Notice that with this approach you may be fetching data from multiple data sources at the same time.

caveats: you can call Rivet commands within a Tcl thread. Rivet commands are not recognized. Perhaps a package require should be issued I'm not keen to mix Tcl threads and the Apache framework: I suspect they wouldn't get along...

 -- Massimo



<<< text/html; name="thread.rvt": Unrecognized >>>
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
For additional commands, e-mail: rivet-dev-h...@tcl.apache.org

Reply via email to