revolution taking up 100% of cpu, again

Jon jbondy at sover.net
Wed Aug 24 11:29:19 EDT 2005


I reported this IDE problem months ago, with a different application, 
but here I go again.  I seem to have a talent for creating problem 
stacks like this.  Last time it was a logic error in one of my handlers.

I am writing an application to test a web site I've written.  Once every 
TBD (typically 15) minutes, it "wakes up" and Posts some data to each of 
three versions of the same web site (supposed to be the same code, only 
on three different servers, one of which is local to my machine).  It 
then inspects the returned HTML to see if the requested operation was 
successful.

I wrote the program to "wake up" every 10 seconds and see whether it is 
time to go yet or not. Two strange things are happening.

1) while the application is supposed to be hitting each web site/server 
once every TBD minutes, it seems as if it may be hitting it 4-5 times, 
all within a fraction of a second.  This undesired behavior (AKA bug?) 
has allowed me to find and fix a number of errors in the web site, but I 
would like to understand how and why it is occurring.  My first thought 
is that multiple Sends are getting triggered when I only wanted one to 
be sent.  I altered the Send statement to be  included in the following 
procedure, to try to control this:

on SendToMyself s 
  local pm, str, theLine
  put the pendingMessages into pm
  repeat for each line theLine in pm
    put char 1 to 3 of item 3 of theLine into str
    if (str <> "rev") then
      cancel item 1 of theLine
    end if
  end repeat
  if (s = 0) then
    send "TestTheReports" to the target
    else
    send "TestTheReports" to the target in s seconds
    end if

Can anyone see a problem with the way this is written?


2) if I run the stack for 20 hours or so, and then click on the Close 
icon, Rev first asks if I want to save the application, after which Rev 
starts to use 100% of the CPU.  I have to go kill the IDE, even though, 
in theory, nothing is running any longer.  This can also happen if I 
switch from Run mode to Edit mode in the IDE, at which point I lose 
EVERYTHING I've worked on (no Save is possible).  I Save the application 
every chance I get because of this.  If I had to guess, I would think 
that the IDE is losing it over residual Sends/messages (see above)

I tried monitoring the Messages, but did not see the spray of messages 
that I had thought that I might: I only see that one message every 10 
seconds.

Any thoughts about this situation?  I can provide the stack if you wish...

:)

Jon





More information about the use-livecode mailing list