Re: Where do asynchronous API do their "work"?
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