Thanks, Mark. I'll continue with the scripting as it has been, which is basically the same as what you have written. I appreciate you documenting the effect on the CPU.

Richard



Mark Smith wrote:
Jaque, I'm not sure this is right, these days.

On my mac laptop I just did this:

button in a new stack with a script:
on mouseUp
  repeat 20
     wait 1 second
  end repeat
  put "done"
end mouseUp

I then opened the Apple Activity Monitor, I could see Revolution using 12% of cpu. Back to the stack, clicked the button. I saw Revolution go up to 19% then quickly down to less than 0%. After 20 seconds, the message box appeared with "done", as expected. And I had the quicktime player playing some music while this was happening.

So I can well believe that all processes that are to do with the running engine will stop during a wait, but it doesn't seem to affect anything else, and it would surely be a gigantic bug if it did, no?


Best,

Mark

On 9 Jun 2009, at 19:06, J. Landman Gay wrote:

Mark Smith wrote:
Craig, you're quite right, and so is Jaque, but in this case, the script is running as a cgi on a server, so has it's own exclusive copy of the engine running it - so nothing else would be getting held up.

Actually, the wait command will stop everything until the wait is done, including all background processes. That means other copies of the Rev engine will also pause until the original script's wait is done. If a bunch of these scripts are all waiting at the same time, I could see a complete lockup happening.

Here's what Scott Raney said about loops like that:
"This loop uses 100% of the CPU time, regardless of the speed of the processor, bringing the system to its knees, causing poor feedback for your app, and making your system unresponsive to any other processes running on it."

He also mentioned: Some of the processes that can slow down or stop when a script uses this kind of processor-intensive repeat loop are: file and printer sharing, HTTP/FTP servers, network management tools, and on UNIX systems (including Mac OS X), people telnetting in from other systems.

A better approach while waiting for a file to appear is to use the "send in time" syntax to continually check for the file. When it becomes available, call a second handler or enter an "else if" clause that completes the processing.

--
Jacqueline Landman Gay         |     jac...@hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to