• 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: Concurrent tasks are getting hung up
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Concurrent tasks are getting hung up


  • Subject: Re: Concurrent tasks are getting hung up
  • From: Greg Parker <email@hidden>
  • Date: Thu, 09 Oct 2014 15:25:05 -0700

On Oct 9, 2014, at 2:54 PM, Steve Mills <email@hidden> wrote:
>
> On Oct 9, 2014, at 15:07:01, Jens Alfke <email@hidden> wrote:
>
>> First check the docs for the CGImage APIs to see what their thread-safety is like. I'm guessing you may need to create a new context for each different thread you use them in. That's relevant because if the operation queue allows operations to run in parallel, they're each effectively on a different thread.
>
> Where does Apple usually put info about whether or not something is thread safe? I thought it was right in the docs after each routine. The one that's hanging for me is CGImageSourceCreateImageAtIndex. Here's the stack. All the stuck threads look like this one:
>
> #0	0x00007fff8d46ca56 in semaphore_wait_trap ()
> #1	0x00007fff90e69451 in _os_semaphore_wait ()
> #2	0x00007fff97c83258 in dispatch_once_f ()
> #3	0x00007fff90efc50f in readMakerNoteProps ()
> #4	0x00007fff8bd982f9 in readMakerNoteProps ()
> #5	0x00007fff8bd4834d in metadataFromDatablock ()
> #6	0x00007fff8bd47bf8 in metadataFromDatablock ()
> #7	0x00007fff8bd7afed in createMetadataFromDatabuffer ()
> #8	0x00007fff8bd7194e in readExifData ()
> #9	0x00007fff8bd705ff in initImageJPEG ()
> #10	0x00007fff8bd6f1d6 in _CGImagePluginInitJPEG ()
> #11	0x00007fff8bd4528c in makeImagePlus ()
> #12	0x00007fff8bd6a469 in CGImageSourceCreateImageAtIndex ()
> #13	0x00000001000052a0 in -[FFGraphicSearch doesImageMatchURL:] at /Users/tut/Dropbox/FotoFind/FotoFind/FFGraphicSearch.mm:161

This thread is stopped inside dispatch_once(), presumably waiting for some other thread to perform the once operation.

Assuming dispatch_once is working normally, there should be one thread inside readMakerNoteProps() and dispatch_once_f() that is doing something else. Can you find it? What is it doing?

One way to break dispatch_once is to throw an exception from the once operation. If you don't see any thread actually executing the once operation then you might try running with an All Exceptions breakpoint and see if anything fails there.


--
Greg Parker     email@hidden     Runtime Wrangler



_______________________________________________

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: Concurrent tasks are getting hung up
      • From: Steve Mills <email@hidden>
References: 
 >Concurrent tasks are getting hung up (From: Steve Mills <email@hidden>)
 >Re: Concurrent tasks are getting hung up (From: Jens Alfke <email@hidden>)
 >Re: Concurrent tasks are getting hung up (From: Steve Mills <email@hidden>)

  • Prev by Date: Re: Concurrent tasks are getting hung up
  • Next by Date: What is fittingSizeHTarget?
  • Previous by thread: Re: Concurrent tasks are getting hung up
  • Next by thread: Re: Concurrent tasks are getting hung up
  • Index(es):
    • Date
    • Thread