Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Asynchronous OT calls on Mac OS X?



Is there any documentation specifically relating to the changes I need to make to a Carbon-ported app to get good performance from async OT calls on OS X?

My app does a huge list of reverse DNS lookups, so the best way to handle it is to use async calls with a notifier function so that the calls can be queued up as some calls will return before others.

So, the calling sequence goes like this ...

InitOpenTransportInContext
OTOpenInternetServicesInContext
OTInstallNotifier
OTSetAsynchronous
OTSetNonBlocking

for each IP address then it loops ...

{
OTInetStringToHost
OTInetAddressToName
}

This works fine, it hits the notifier function and gets the resolved address. The only problem is it is mind-bogglingly slow, perhaps 10 times slower than on OS 9. So I'm guessing it has something to do with the event model on OS X. I'm using WaitNextEvent(), and everywhere in the code now I'm using 0x7FFFFFFFF for the sleep time as recommended to make sure that the OS doesn't spend too much time polling. This doesn't seem to have made much difference, so I'm not sure what else I can do. Should the process be non-blocking or blocking, and do I have to do other things in my event loop to free up more time? Should I be using true threading for this with synchronous calls?

Hoping someone has already worked this one out!

Cheers,
Richard

Mac Developer
Quest Software
email@hidden




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.