• 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: NSURLDownload notifies on wrong thread?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLDownload notifies on wrong thread?


  • Subject: Re: NSURLDownload notifies on wrong thread?
  • From: Robert Nicholson <email@hidden>
  • Date: Thu, 7 Jun 2007 03:29:22 +0700

In automator actions method calls are synchronous. I'm interested in knowing what approaches people take when using NSURLDownload in an automator action. Do you poll with a sub event loop where you're detach thread? so if you have a number of batches to complete and they must all finish before returning how do you 1. keep the delegate methods firing and 2. ensure all batches are finished before returning.

for 1. i've used a subevent loop keeping track of when all batches are finished in order to exit the loop.

for 2. i've used a NSConditionLock but i'm not convinced this is the best way.

if you don't use 1. and just rely on 2. the delegate methods will not fire.

secondly when i do this and want to communicate the results of each batch back to the calling thread I use an NSMachPort but it seems for some reason it blocks when the delegate method for the port is sent or at least when accessing the components of the NSPortMessage.

Presumably if you get notified on the wrong thread you don't have the contextual information you're seeking?



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >NSURLDownload notifies on wrong thread? (From: "Doug Knowles" <email@hidden>)

  • Prev by Date: Re: Problem with Bluetooth API
  • Next by Date: NSTextFieldCell and -stopTracking::
  • Previous by thread: Re: NSURLDownload notifies on wrong thread?
  • Next by thread: Question about NSArrayController
  • Index(es):
    • Date
    • Thread