[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Ensuring consent for multitasking



At 8:43 AM -0700 7/6/99, Rich Morin wrote:
>I have a script (based on File::Find) that rummages through a few
>thousand directories, examining many thousands of files.  It prints
>out one line per directory during an acquisition phase, then prints
>a summary report file in the second (and final) phase.
>
>The script works just fine, but it is unwilling to let any other app
>come to the foreground while it is running.  Is there something I
>should do to ensure that other applications can come in?  (Just doing
>I/O isn't enough; its already doing quite a bit of that...)
>
>One possibility is calling sleep every 10 directories or so, but
>this seems pretty hokey and would slow the script down quite a bit.
>If this were Unix, I could do a nice(); does Mac OS have anything of
>that sort?
>
>More generally, all suggestions are welcome!

The usual way to do this in the Mac environment is with GetNextEvent or
WaitNextEvent.  WaitNextEvent is (as of several years ago - mind you) the
more modern approach.  It should be available as part of the Toolbox stuff.
If I remember correctly some of Kevin Reid's fabu graphic scripts use it,
so you can find examples there.

-Jeff Lowrey



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org