• 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
NSFileHandle thread safe ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSFileHandle thread safe ?


  • Subject: NSFileHandle thread safe ?
  • From: Alec Carlson <email@hidden>
  • Date: Tue, 13 Sep 2005 12:05:29 -0500

I am using an NSFileHandle to read/write to a device. For reading I am using
the :readInBackgroundAndNotifyForModes: method. The device is asynchronous
and can return data to the Mac at any time.

Now, when device data is read in the NSFileHandle background thread,
NSFileHandle posts an NSFileHandleReadCompletionNotification notification.
My question is, are these notifications executed in the context of the
NSFileHandle background thread or are they executed off of the main run loop
? This has a bearing on whether I can :writeData: from both the main thread
AND the NSFileHandleReadCompletionNotification method. The documentation
only specifies that the notification is posted, but not it's context.

Opinions ?

Thanx -

Alec Carlson
-----------------------------------------------------------------------
                 Time is Short, and the Water Rises
-----------------------------------------------------------------------



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSFileHandle thread safe ?
      • From: Finlay Dobbie <email@hidden>
    • Re: NSFileHandle thread safe ?
      • From: j o a r <email@hidden>
    • Re: NSFileHandle thread safe ?
      • From: Ryan Britton <email@hidden>
    • Re: NSFileHandle thread safe ?
      • From: Pontus Ilbring <email@hidden>
  • Prev by Date: Re: ScrollView change notification
  • Next by Date: NSWindowContoller communication issues
  • Previous by thread: Re: Launching another process, and knowing when it's loaded?
  • Next by thread: Re: NSFileHandle thread safe ?
  • Index(es):
    • Date
    • Thread