Multithreading with DO and Notifications
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.