• 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: NSImage from bitmap - then delete bitmap
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage from bitmap - then delete bitmap


  • Subject: Re: NSImage from bitmap - then delete bitmap
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 22 Jul 2016 20:02:25 -0700
  • Feedback-id: 167118m:167118agrif8a:167118sKiax6pMTK:SMTPCORP

On Jul 22, 2016, at 19:29 , Graham Cox <email@hidden> wrote:
>
> If the worker thread is waiting for -performOnMainThread to complete, it *cannot* possibly get a call from the main thread to terminate

I nodded agreement when I first read this, then “but wait!” …

Your logic seems flawed on two counts:

1. The selector performed by the worker thread may still be queued, so the main thread is doing something else which may result in an attempt to terminate the worker thread.

2. The worker method performed on the main thread may directly or indirectly lead to an attempt to terminate the worker thread.

Both scenarios could cause a deadlock. At least, that’s my attempt at logic.

The real problem is that it’s simply a bug to have two threads with mutual, synchronous, unconditional waits. Of course that’s going to deadlock eventually.

_______________________________________________

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: NSImage from bitmap - then delete bitmap
      • From: Trygve Inda <email@hidden>
References: 
 >Re: NSImage from bitmap - then delete bitmap (From: Trygve Inda <email@hidden>)
 >Re: NSImage from bitmap - then delete bitmap (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: NSImage from bitmap - then delete bitmap
  • Next by Date: Re: NSImage from bitmap - then delete bitmap
  • Previous by thread: Re: NSImage from bitmap - then delete bitmap
  • Next by thread: Re: NSImage from bitmap - then delete bitmap
  • Index(es):
    • Date
    • Thread