Kriston has mentioned that there are problems with exec in a multithreaded
environment, mostly in reference to using CGI; still if they're present at
that level, I'd expect they're also present for Tcl's exec command.  I'm
not sure what the problems are, but I can imagine some issues (signal
handling is a tricky business in threaded apps, for example).

Another way to approach your problem would be to implement the Glimpse
interface as an external database driver.  AOLserver is good about taking
care of the processes it executes to spin off db proxies (hmmm...wonder
why there's no trouble there, but there's trouble in CGI...note to self:
possible line of investigation there).  You could write a DB proxy that
accepts a Glimpse query, runs it, and returns the result as a single
column in a single row.  I've done this for other external interfaces.  If
Glimpse has a daemon process to which you can connect and run queries,
that's even better, because then you can take advantage of AOLserver
connection pooling.

Sorry I don't have an answer for exec, but the db proxy is one avenue you
might be able to explore.

Pete.

On Friday, May 10, 2002, at 09:09 AM, Babak Ashrafi wrote:

> We are using AOLServer 3.4.2 on FreeBSD 4.5 and Glimpse for searching.
> The search engine is called with an 'exec' command from a .tcl file.
> While this search is being executed, AOLServer completely stops serving
> anything at all.  After the search results are returned, everything is
> fine.
>
> We can write a tcl script or a database query that nearly saturates the
> cpu and the web site feels ok from a browser.  But a search called through
> exec, that takes only 10% of the CPU, will freeze the web site until the
> exec is done.  The same happens if we use open instead of exec.
>
> Is there a problem with exec, or is there a better way to do this?

Reply via email to