• 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
Main Thread stoppin Background Thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Main Thread stoppin Background Thread


  • Subject: Main Thread stoppin Background Thread
  • From: John Love <email@hidden>
  • Date: Fri, 28 Nov 2008 14:48:50 -0500

Reference page 43 of Apple's MultiThreading.pdf.

I conclude from this page that the preferred, if not only, way to have the main thread stop the background thread is through KVC.

Before I continue to inflict more pain on myself, why can't I simply toggle the value of an instance variable of the class' interface from the main thread and have the backgroundThreadRoutine look at the same variable and break out of the background thread if its a certain value?

I have been totally unsuccessful in this simpler-to-understand approach; therefore, I am beginning to study KVC and its use on page 43 of Apple's doc.

Should I conclude that this class variable is in the main thread and is not accessible by the background thread?

If KVC is the only approach for inter-thread communication, I'll press on.

A short amount of guidance is definitely needed.

Thanks,

John Love

_______________________________________________

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: Main Thread stoppin Background Thread
      • From: Joseph Kelly <email@hidden>
    • Re: Main Thread stoppin Background Thread
      • From: Ken Thomases <email@hidden>
    • Re: Main Thread stoppin Background Thread
      • From: Jason Coco <email@hidden>
  • Prev by Date: Re: Using a string as filepath
  • Next by Date: Re: Using a string as filepath
  • Previous by thread: Re: Effectively fetching console messages
  • Next by thread: Re: Main Thread stoppin Background Thread
  • Index(es):
    • Date
    • Thread