Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!utgpu!water!watmath!clyde!rutgers!nysernic!itsgw!batcomputer!pyramid!prls!gardner
From: gardner@prls.UUCP
Newsgroups: comp.sys.mac
Subject: Re: MultiFinder programming tip
Message-ID: <7901@prls.UUCP>
Date: Mon, 7-Dec-87 18:08:16 EST
Article-I.D.: prls.7901
Posted: Mon Dec  7 18:08:16 1987
Date-Received: Sat, 12-Dec-87 19:04:24 EST
References: <6897@apple.UUCP> <7838@prls.UUCP> <6907@apple.UUCP>
Reply-To: gardner@prls.UUCP (Robert Gardner)
Organization: Philips Research Labs, Sunnyvale, California
Lines: 39

In article <6907@apple.UUCP> goldman@apple.UUCP (Phil Goldman) writes:
>In article <7838@prls.UUCP> gardner@prls.UUCP (Robert Gardner) writes:
>>In article <6897@apple.UUCP> han@apple.UUCP (Byron Han) writes:
>>>A tip for MultiFinder friendly programming.

>>>Whenever you call GetNextEvent/WaitNextEvent, you should ALWAYS be
>>>prepared to handle updates and also suspends/resumes.  ALWAYS.  

>>This sounds like a Multifinder bug. It also sounds like a pain.

>It is not a MultiFinder bug, but it is a pain.

>It is not quite true that you have to always be prepared to handle update
>events.  For example, if you are in the foreground in the middle of some
>high priority mouse tracking code, you might want to only look for mouse
>events.  The key is to handle update events in a timely fashion while in the
>background (i.e. not the frontmost layer).  MultiFinder will stop feeding an
>app in the background update events after a certain large number go by without
>it updating.  It is simply to costly on the system to run through this app
>over and over.

Explanation appreciated. I read suspend/resume and thought activate/de-
activate. I guess my mind hasn't been Multifinder-ized yet.

This does raise a big question for me, though. The main place I call
*NextEvent outside the main loop is in ModalDialog replacements. 
Supposedly, I will never be using this routine while in the background. 
So, do I need to worry about this problem in ModalDialog replacements?

In otherwords, the "ALWAYS" above should be "whenever there's a possibility
it will be executed in the background". Do I understand this correctly?

Thank you,
Robert Gardner

P.S. Are people going to start getting annoyed with modal dialogs if
they can't switch out of them? Should I work on replacing all my modal
dialogs with modeless ones (or "quasi-modal, draggable dialogs" like
in MS Word 3)?