Serial IO seems to be starving UI
Serial IO seems to be starving UI
- Subject: Serial IO seems to be starving UI
- From: Rick Mann <email@hidden>
- Date: Thu, 29 Jan 2009 23:08:00 -0800
Sorry for the cross-post, but I thought both these lists might have
advice to offer.
I just dusted off an app I'd worked on several months ago. It used to
work fine (prior to 10.5.6), but now it behaves very erratically. I'm
not blaming 10.5.6 necessarily, it's just that's all I can think of
that might have changed.
Basically, it uses NSFileHandle on a serial port to get notified when
data is available. The data is coming in at 9600 baud. It parses the
packets, then sends the packets to some code that graphs the values.
I've been able to determine that valid data is coming in fairly
frequently, and the packets are parsing correctly. This ends up
calling -setNeedsDisplay: on my view, but the view's draw code is only
called once in a very long while (30 seconds or more, but sometimes
it'll get called faster).
There is also a view that shows the raw bytes, and it, too, updates
only when the graph view updates.
I tried running Shark, but I'm not very good at using it or
interpreting the results. It seems to spend 49% of the time on
__semwait_signal, and 50% of the time in the read routine (with a lot
of the time going to makeKeyAndOrderFront, for some reason).
Like I said, this used to work pretty flawlessly, and now it's very
unhappy. Any suggestions would be very welcome.
Thanks!
--
Rick
_______________________________________________
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