Re: vwait behavior
- From: "Gerald W. Lester" <Gerald.Lester@xxxxxxx>
- Date: Thu, 06 Mar 2008 15:58:53 -0600
rfwooden84@xxxxxxx wrote:
By crash, I mean that the process stops running. The global gv is
carried over from another use and its not needed in this case. Below
is the actual code I have run that unexpectedly stops running after 2
or 3 days.
Is that really *all* of the actual code or do you have more code in there?
If that is really all, then you seem to have overly complicated things.
Thanks,
Doug
-------------------------------------------
#!/usr/bin/tclsh
# pauses for n milliseconds
proc pause { {msecs 1000} } {
global gv;
after $msecs "set vpause 1"
vwait vpause
}
set ofname [format "zg_log.txt"]
proc fputs { msg } {
set t [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S"]
puts $::ofptr "$t: $msg"
}
proc fappend { info msg } {
set ::ofptr [open $::ofname a]
fputs "$info> $msg"
close $::ofptr
}
while { 1 } {
fappend zg entering
fappend zg "will pause for 3600 sec (1 hour)"
for { set jnx 0 } { $jnx < 6 } { incr jnx } {
pause 600000
}
fappend zg "pause is over, now we will loop back and repeat"
}
--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
.
- References:
- vwait behavior
- From: rfwooden84
- Re: vwait behavior
- From: George Peter Staplin
- Re: vwait behavior
- From: rfwooden84
- vwait behavior
- Prev by Date: Re: Tcl Threads
- Next by Date: Re: vwait behavior
- Previous by thread: Re: vwait behavior
- Next by thread: Re: vwait behavior
- Index(es):