Re: vwait behavior



On Mar 5, 8:46 pm, rfwoode...@xxxxxxx wrote:
I've been wrestling with this problem for several days now. I run the
following loop on a linux (red hat) web server and it will run fine
for sometimes up to 2 or 3 days before it crashes. Most often it runs
for less than 48 hours. (I know it was not due to a server crash -
according to uptime.)

Is there something wrong with the way I'm implementing the pause proc
that causes some weird behavior?

Thanks for any help!

# pauses for n milliseconds
proc pause { {msecs 1000} } {
global gv;
after $msecs "set vpause 1"
vwait vpause

}

My guess is you are crashing due to stack overflow. The problem is
that Tcl events / event handlers are not independent, but are stacked;
search for "recursive event loop". If some event occurs while you are
paused, the pause cannot return when its time is up, but can only
return when the nested event handler is complete. If you have some
fraction of events that take a long time to handle or invoke [pause]
then the stack will keep growing.

Donald Arseneau asnd@xxxxxxxxx

.



Relevant Pages

  • Re: vwait behavior
    ... following loop on a linux web server and it will run fine ... search for "recursive event loop". ... fraction of events that take a long time to handle or invoke [pause] ... Doesn't apply here since there's no way for vwaits to nest (assuming ...
    (comp.lang.tcl)
  • Re: any try this forth webserver? the code looks incomprehensible to me http://www.jwdt.com/~paysan/
    ... statements; what are the control variables in a loop; what arguments ... web server works, then none of this is going to make any sense to ... web servers like Apache, your mind seemed to latch onto the notion ... He only cares about text/html, ...
    (comp.lang.forth)
  • Re: Thread.Abort()
    ... private _myThread ... private _continueEvent System.Threading.ManualResetEvent ... private enumerated type _state (pause, stop, start, resume) ... end loop ...
    (microsoft.public.dotnet.languages.csharp)
  • Variable/Field value not being held
    ... A for-next loop is not the equivalent of a pause. ... >back into a field on the first form ~ Code runs through ... >yet then how could the calculation take place ~ not so, ...
    (microsoft.public.access.forms)
  • Re: Number of pause seconds is out of range
    ... Pause using the JOB to wait for the job to finish, ... created and the WHILE loop would exit when more than 20 CPU seconds expire. ... I'm running a stream job that streams other jobs. ... * To join/leave the list, search archives, change list settings, * ...
    (comp.sys.hp.mpe)