• 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
Screen saver using Asynchronous IO lags at close
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Screen saver using Asynchronous IO lags at close


  • Subject: Screen saver using Asynchronous IO lags at close
  • From: Justin Delegard <email@hidden>
  • Date: Sun, 17 Jan 2010 13:59:22 -0500

I am writing a screen saver that forks a process and reads its stdout chunk by chunk.  Since I didn't want it to block on reads, I tried to find the non-blocking IO parts of Cocoa.  I found Cocoa's NSNotificationCenter, and the associated methods with the NSFileHandle class, and that seemed to fit the bill.  It works fine *except* it doesn't notice the closes.

My guess is it has something to do with the main loop being blocked after the close.  It notices the last chunk of data and the close at the same time, but then it never notices after my last waitForDataInBackgroundAndNotify call.  I don't want the routine reading the data to be blocked, but I want to know in a timely way if the file handle is closed.  How do I do that?  What should I be doing?

Justin

_______________________________________________

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

  • Prev by Date: Re: RegexkitLite - Possible bug?
  • Next by Date: Blocking for input during a loop?
  • Previous by thread: Re: RegexkitLite - Possible bug?
  • Next by thread: Blocking for input during a loop?
  • Index(es):
    • Date
    • Thread