Re: Serial IO seems to be starving UI
Re: Serial IO seems to be starving UI
- Subject: Re: Serial IO seems to be starving UI
- From: Michael Ash <email@hidden>
- Date: Sat, 31 Jan 2009 00:21:50 -0500
On Fri, Jan 30, 2009 at 8:00 PM, Kyle Sluder <email@hidden> wrote:
> On Fri, Jan 30, 2009 at 1:21 PM, A.M. <email@hidden> wrote:
>> What is likely happening is that the NSFileHandle processing is starving the
>> main NSRunLoop. This happens because NSRunLoop processes non-user input
>> before it processes user events (which seems backwards for the main run loop
>> but is nevertheless the case).
>
> Actually it makes perfect sense. If an event causes a method to call
> -performSelector:withObject:afterDelay:, that selector should
> logically be applied before the next event is processed.
That's an argument for prioritizing that one particular kind of event
(assuming you meant with a 0 delay, anyway) but not an argument for
prioritizing *all* non-user events. And even there, a continuous
sequence of 0-delay performs should not lock the user out of your
program. Seems to me that most non-user events should be interleaved
in with user events based on when they occur, or at the very least
given equal time. It's too easy to lock up the main event loop such
that the user can no longer do anything otherwise.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden