Re: vwait behavior
- From: Donald Arseneau <asnd@xxxxxxxxx>
- Date: Thu, 6 Mar 2008 11:52:56 -0800 (PST)
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
.
- Follow-Ups:
- Re: vwait behavior
- From: Schelte Bron
- Re: vwait behavior
- From: Alexandre Ferrieux
- Re: vwait behavior
- References:
- vwait behavior
- From: rfwooden84
- vwait behavior
- Prev by Date: Re: Automatic Notification of a File Change
- Next by Date: Re: New/improved POP3 tcllib package ?
- Previous by thread: Re: vwait behavior
- Next by thread: Re: vwait behavior
- Index(es):
Relevant Pages
|
|