• 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: Thread deadlock?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread deadlock?


  • Subject: Re: Thread deadlock?
  • From: Trygve Inda <email@hidden>
  • Date: Mon, 11 Aug 2008 22:07:29 +0000
  • Thread-topic: Thread deadlock?

>> There is a chance that my calls to performSelectorOnMainThread can have
>> waitUntilDone:NO
>>
>> I use [myNSData writeToFile:path atomically:YES]
>>
>> NSFileHandle and NSFileManager are shown as not thread safe, but NSData
>> is... Perhaps it is ok, but I would think NSData uses one or both of the
>> above.
>>
>> One of the calls to performSelectorOnMainThread may need to wait on a file
>> download, but I think that could be a different lock.
>
> I think you're missing the point: once the thread has detected that it
> should quit, it calls as its last statement performSelectorOnMainThread for
> whatever needs to be done on the main thread, and then just falls off the
> end. When the the selector is called in the main thread, you know at that
> point that the thread is done--there's no need to wait for the thread to
> terminate.
>
> What do you need done that is not done by the sample code that I posted?

In the middle of the thread processing, I need to do some processing on a
downloaded file. The file may be in the middle of being downloaded, so I
need to possibly block until it is ready, then have the main thread do some
work, and return to the thread.

T.


_______________________________________________

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: Thread deadlock?
      • From: Scott Ribe <email@hidden>
References: 
 >Re: Thread deadlock? (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: including a cocoa bundle in a carbon app
  • Next by Date: List box like in Mail app
  • Previous by thread: Re: Thread deadlock?
  • Next by thread: Re: Thread deadlock?
  • Index(es):
    • Date
    • Thread