• 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
Multithreading with DO and Notifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multithreading with DO and Notifications


  • Subject: Multithreading with DO and Notifications
  • From: Greg Hulands <email@hidden>
  • Date: Sat, 26 Apr 2003 15:41:03 +1000

In my application I detach a worker thread to import a heap of images.
It communicates with a model object via DO so it can update its status
of the percentage completed of the import. In the update progress
method it looks like this
- (void)inputCaptureCompletionChanged:(float)amount
{
_inputCaptureCompletion = amount;
[self didChange];
if ((int)amount == 1)
[[NSNotificationCenter defaultCenter]
postNotificationName:DLSOrderCompletedInputCaptureNotification

object:self];
}
The problem occurs when the notification gets posted that because
NSNotificationCenter is syncro it then dispatches the notification
before the thread the called it has exited. I have searched mamasam but
could not find a definitive solution. Does anyone have any suggestions
on how to solve this as I am architecturally going out of my mind. I
have tried making a timer fire to post the notification, but the same
thing still happens.

Any help is greatly appreciated.

Regards,
Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Multithreading with DO and Notifications
      • From: Drew McCormack <email@hidden>
  • Prev by Date: Re: Quicktime Atoms
  • Next by Date: Re: A pie analyzer
  • Previous by thread: Re: OS9 Icons in OSX apps
  • Next by thread: Re: Multithreading with DO and Notifications
  • Index(es):
    • Date
    • Thread