• 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
Timing distributed notifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Timing distributed notifications


  • Subject: Timing distributed notifications
  • From: "McLaughlin, Michael P." <email@hidden>
  • Date: Thu, 6 May 2010 13:34:03 -0400
  • Acceptlanguage: en-US
  • Thread-topic: Timing distributed notifications

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 (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: Timing distributed notifications
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: NSBox sizeToFit problem
  • Next by Date: Re: Timing distributed notifications
  • Previous by thread: Re: drawRect not called when hosting Layers
  • Next by thread: Re: Timing distributed notifications
  • Index(es):
    • Date
    • Thread