• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
design pattern for data acquisition in background thread?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

design pattern for data acquisition in background thread?


  • Subject: design pattern for data acquisition in background thread?
  • From: Joe Keenan <email@hidden>
  • Date: Fri, 26 Sep 2008 18:37:42 -0400

I have an application that acts as a GUI front end for a network device. The device has a telnet server, so I'm using a ASyncSocket to open a connection and talk telnet commands to it. That's all working fine. The problem is that the UI is totally unresponsive while it's doing an update, and it's 25 or so round trips to the server (telnet command/responses) for each update.

Right now, the app controller object sends a message to the device controller, requesting the value of a specified variable. The device controller does the telnet command to get it, returns it to the app controller, and the app controller sends it to the text field. Repeat 25 times for a full update. Slow, and there's no return to the run loop in there to allow for keyboard or UI events.

I'm looking for suggestions on how to deconstruct this to get the object talking to the device into another thread so the main window can take UI events. I'm thinking I can package up the variable requests into a dictionary so that the device controller can do a bunch at once. Then the main thread can do all the updates from the dictionary, which should be quick.

joe

_______________________________________________

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


  • Follow-Ups:
    • Re: design pattern for data acquisition in background thread?
      • From: Michael Atwood <email@hidden>
    • Re: design pattern for data acquisition in background thread?
      • From: Chris Hanson <email@hidden>
  • Prev by Date: Re: Autostart item in user profile.
  • Next by Date: Subviews in flipped layer-backed views
  • Previous by thread: NSTreeController -moveNode:toIndexPath doesn't work correctly
  • Next by thread: Re: design pattern for data acquisition in background thread?
  • Index(es):
    • Date
    • Thread