• 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
Re: Integrating NSOutputStream and NSOperation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Integrating NSOutputStream and NSOperation


  • Subject: Re: Integrating NSOutputStream and NSOperation
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 11 Nov 2015 08:53:50 -0800


On Nov 11, 2015, at 3:46 AM, Motti Shneor <email@hidden> wrote:

If I (upon starting my operation) schedule the outputStream on the current operation’s runloop like thus:

    [self.outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];

That won’t work because dispatch queues (other than main) and NSOperationQueues don’t have runloops. (If you call +currentRunLoop you do create a new runloop for whatever thread the queue is using, but that runloop won’t do anything because there’s no outer loop on that thread servicing it.)

If I can change the outputStream’s scheduling to use the same of my currently running operation - that should solve my synchronizing problem. My operation can bail safely, and be re-called on its own thread, without concurrency.

You can use CFWriteStreamSetDispatchQueue to schedule the stream on a queue instead of a runloop.

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

This email sent to email@hidden

  • Follow-Ups:
    • Re: Integrating NSOutputStream and NSOperation
      • From: Motti Shneor <email@hidden>
References: 
 >Integrating NSOutputStream and NSOperation (From: Motti Shneor <email@hidden>)

  • Prev by Date: Integrating NSOutputStream and NSOperation
  • Next by Date: Re: Integrating NSOutputStream and NSOperation
  • Previous by thread: Integrating NSOutputStream and NSOperation
  • Next by thread: Re: Integrating NSOutputStream and NSOperation
  • Index(es):
    • Date
    • Thread