<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://community.activestate.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>ActiveState Community Site - Tcl process goes to sleep when running as Apache cgi script - Comments</title>
 <link>http://community.activestate.com/forum-topic/tcl-process-goes-sleep-when-running-apache-cgi-script</link>
 <description>Comments for &quot;Tcl process goes to sleep when running as Apache cgi script&quot;</description>
 <language>en</language>
<item>
 <title>I think this is fixed. I</title>
 <link>http://community.activestate.com/forum-topic/tcl-process-goes-sleep-when-running-apache-cgi-script#comment-3021</link>
 <description>&lt;p&gt;I think this is fixed. I need to use the mod_cgid module instead of the mod_cgi module in Apache and configure it to use a named socket. This finctionality seems to be explicit to HP-UX. Preliminary testing indicates that it&#039;s working fine.&lt;/p&gt;
</description>
 <pubDate>Wed, 26 Sep 2007 08:55:35 -0700</pubDate>
 <dc:creator>Dave.McIsaac</dc:creator>
 <guid isPermaLink="false">comment 3021 at http://community.activestate.com</guid>
</item>
<item>
 <title>Thanks jeffh - I tried this</title>
 <link>http://community.activestate.com/forum-topic/tcl-process-goes-sleep-when-running-apache-cgi-script#comment-2953</link>
 <description>&lt;p&gt;Thanks jeffh - I tried this and it made no difference. I&#039;m sorry if I implied that I think the problem is with Tcl. I don&#039;t! I think the problem is with the way HP handles communications between processes on their A class machines running HP-UX 11i. I was hoping someone may have encountered the same or a similar problem and had come up with a work-around for it.&lt;/p&gt;
</description>
 <pubDate>Fri, 21 Sep 2007 04:55:40 -0700</pubDate>
 <dc:creator>Dave.McIsaac</dc:creator>
 <guid isPermaLink="false">comment 2953 at http://community.activestate.com</guid>
</item>
<item>
 <title>Re: Tcl process goes to sleep</title>
 <link>http://community.activestate.com/forum-topic/tcl-process-goes-sleep-when-running-apache-cgi-script#comment-2940</link>
 <description>&lt;p&gt;There is nothing in the description which would explain any kind of change in Tcl&#039;s behavior as perceived.  Are you sure that something isn&#039;t causing the event loops to run and that perhaps you need an explicit exit?&lt;/p&gt;
&lt;p&gt;The one change I would make to your script is to try converting the split/read into a while/gets.  It sounds like you may be stuck in the read, which would be expecting an EOF and not getting it.&lt;/p&gt;
</description>
 <pubDate>Thu, 20 Sep 2007 11:36:19 -0700</pubDate>
 <dc:creator>jeffh</dc:creator>
 <guid isPermaLink="false">comment 2940 at http://community.activestate.com</guid>
</item>
<item>
 <title>Tcl process goes to sleep when running as Apache cgi script</title>
 <link>http://community.activestate.com/forum-topic/tcl-process-goes-sleep-when-running-apache-cgi-script</link>
 <description>&lt;p&gt;I have been using Tcl for cgi scripts on an Apache server for several years now. This is all running on an HP-UX workstation (OS Hp_UX 11i). We just migrated the whole thing to an HP A500 class server with dual processors and a LOT more memory (still HP-UX 11i). Now the cgi scripts that are used to pre-load an html form from an existing data set take upwards of 8 minutes to complete. Using the top command shows that tclsh is sleeping. I THINK that the server eventually times out which causes the data to be flushed and sent back to the client. If I wait for this to happen then it seems to work fine from then on. If I log in to the server as a different user I have to wait again. If I attach truss (to monitor the execution steps) to the parent server process it works fine right from the start.&lt;br /&gt;
The Tcl script is executing the following procedure:&lt;br /&gt;
proc SendHtml {args} {&lt;br /&gt;
    set outID [open [lindex $args 0] r]&lt;br /&gt;
    foreach line [split [read -nonewline $outID] \n] {&lt;br /&gt;
       puts stdout [subst -nobackslashes $line]&lt;br /&gt;
    }&lt;br /&gt;
    close $outID&lt;br /&gt;
    return&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;Has anyone experienced a similar problem or know how to fix this or work around it? This thing is driving me nuts.&lt;br /&gt;
Thanks&lt;/p&gt;
</description>
 <comments>http://community.activestate.com/forum-topic/tcl-process-goes-sleep-when-running-apache-cgi-script#comments</comments>
 <category domain="http://community.activestate.com/forums/activetcl-discussion-0">ActiveTcl discussion</category>
 <category domain="http://community.activestate.com/os/hp-ux-pa-risc">HP-UX ( PA-RISC )</category>
 <pubDate>Thu, 20 Sep 2007 08:13:05 -0700</pubDate>
 <dc:creator>Dave.McIsaac</dc:creator>
 <guid isPermaLink="false">1441 at http://community.activestate.com</guid>
</item>
</channel>
</rss>
