Is there a recommended way of determining that the currentRunLoop in a
subordinate task (executable) is, in fact, running and ready to receive a
distributed notification?

I have one subtask for each CPU, all launched during the init method of my
app.  Each subtask responds with a "ready" message early in its main()
function.  The last thing in this subtask main() is

[[NSRunLoop currentRunLoop] run];

Later, after a File Menu selection in the app, the app informs the subtasks
of the selection via

[[NSDistributedNotificationCenter defaultCenter]
postNotificationName:@"newCase" object:[notif object]];

Currently, there is only one kind of subtask and this all works quite well.
However, one day I'll have to specify the subtask *after* the File Menu
selection.

Problem: If I postpone the launching of the subtasks accordingly, then the
subtasks' currentRunLoops do not (are not ready to ?) receive the broadcast
message given above (at the time it is now sent) even though all the
subtasks' "ready" messages have been received by the app.

Therefore, I need some kind of check to tell me that it is OK to broadcast
this newCase message.

Any tips?

Thanks.

-- 
Mike McLaughlin

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to