Boxes, Grids, & Snap to Objects
Scott Raney
raney at metacard.com
Thu Feb 21 00:37:01 EST 2002
On Wed, 20 Feb 2002 Geoff Canyon <gcanyon at inspiredlogic.com> wrote:
>
> At 10:47 AM -0700 2/20/02, Scott Raney wrote:
> >And the very worst thing to do with any of these is "repeat until
> ><function>", which will condemn you to the fires of eternal damnation
> >in multiuser hell ;-)
>
> I assume the same warning applies to:
>
> wait until (the optionKey is "down"|the mouse is "down"|etc.)
>
> Is that correct?
It goes doubly for that ;-)
> Also, can you elaborate a bit on what you mean by "multiuser hell?"
> Is there something specific about a multi-user system that
> contraindicates these functions and messages such as mouseWithin and
> idle?
Yes: timeshare systems (including UNIX and NT/2000/XP) penalize
processes that take up too much CPU time by giving them lower priority
than other processes. After being a CPU hog for too long, users will
find your app becoming increasingly less responsive as time gets
devoted to other processes. Now none of this really matters if the
only significant thing running on your system is a single app that
you're using. But if anything else is running (like an HTTP or file
or print server), these techniques will take time away from those
other processes, and cause the OS to penalize your app to make up the
difference. Which will make your app feel less responsive to the
user, making you (and us) look bad.
> Just looking to get edjumacated. I've found it to be a useful debugging tool to take an existing script and insert something like:
>
> put somethingUsefulToExamine
> wait until the optionKey is "down"
>
> Doing so allows me to quickly check a value deep in a repeat loop, something the debugger is less suited to because of its impact on script execution speed. But I've also found circumstances where, as you described, repeated polling the optionKey seemed to cause a problem.
>
This is a fine use of those functions. Pretty much anything you only
do during development or only when running the app on your own system
is going to be OK. It's giving (let alone selling) these CPU hogging
programs to *other* users that's a bad idea.
Regards,
Scott
> regards,
>
> Geoff
********************************************************
Scott Raney raney at metacard.com http://www.metacard.com
MetaCard: You know, there's an easier way to do that...
More information about the use-livecode
mailing list