• 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
Synchronous method: How to "wait" for Notification to occur?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Synchronous method: How to "wait" for Notification to occur?


  • Subject: Synchronous method: How to "wait" for Notification to occur?
  • From: Rolf <email@hidden>
  • Date: Thu, 21 Aug 2003 21:26:16 +0200

Hi all,

A class I have created has a synchronous method which must not return until some asynchronous operation has completed and the result is ready. The asynchronous operation typically takes 20 - 500 mS to complete. The asynchronous operation signals its completion by a Notification.
What's the most elegant way for the method to "wait" for the Notification ? The main RunLoop must be kept active, and the "wait" must not hog CPU time by continually checking if the Notification has arrived. Any good ideas ?

/Rolf
_______________________________________________
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: Synchronous method: How to "wait" for Notification to occur?
      • From: Chris Hanson <email@hidden>
    • Re: Synchronous method: How to "wait" for Notification to occur?
      • From: Wade Tregaskis <email@hidden>
    • Re: Synchronous method: How to "wait" for Notification to occur?
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: OCUnit
  • Next by Date: Re: OCUnit
  • Previous by thread: Re: OCUnit
  • Next by thread: Re: Synchronous method: How to "wait" for Notification to occur?
  • Index(es):
    • Date
    • Thread