• 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
Re: Where do asynchronous API do their "work"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where do asynchronous API do their "work"?


  • Subject: Re: Where do asynchronous API do their "work"?
  • From: email@hidden
  • Date: Sun, 13 Nov 2005 12:38:52 +1100

API which call back to you as they progress (which I call "asynchronous")
may run in another thread of some kind. (On the other hand, they may not,
as I learned when I ran a long blocking process in my main thread while an
NSDrawer was supposed to opening).

Most things use the current runloop, where possible, as each additional thread introduces more overhead, and the setup & kill overhead alone can be excessive for tasks which are largely one-off (such as performing a UI animation).


As a rule of thumb, if you're going to work with the Cocoa API's in an asynchronous fashion anywhere, it's wise to run the current runloop periodically - manually, if you must. So your blocking code need only do that once in a while to resolve your problem.

I'm studying a problem with NSURLConnection, and wonder if there is any way
to see any "thread-like things" it might spawn. I don't see anything in
Activity Monitor.

You could use gdb and break on pthread_create?

Wade Tregaskis

    ICQ: 40056898
    AIM, Yahoo & Skype: wadetregaskis
    MSN: email@hidden
    iChat & email: email@hidden
    Jabber: email@hidden
    Google Talk: email@hidden

    http://homepage.mac.com/wadetregaskis/

-- Sed quis custodiet ipsos custodes?


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Where do asynchronous API do their "work"?
      • From: Shawn Erickson <email@hidden>
    • Re: Where do asynchronous API do their "work"?
      • From: Jerry Krinock <email@hidden>
References: 
 >Where do asynchronous API do their "work"? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Where do asynchronous API do their "work"?
  • Next by Date: Re: How to see the arguments of methods from the stack trace during debugging
  • Previous by thread: Where do asynchronous API do their "work"?
  • Next by thread: Re: Where do asynchronous API do their "work"?
  • Index(es):
    • Date
    • Thread