• 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: Thread synchronization via queue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread synchronization via queue


  • Subject: Re: Thread synchronization via queue
  • From: Kyle Sluder <email@hidden>
  • Date: Thu, 17 Jan 2013 08:22:43 -0800

On Jan 17, 2013, at 2:09 AM, Charles Srstka <email@hidden> wrote:

> You could start a run loop in a dispatch queue, schedule the NSInputStream on that runloop, and then have the delegate methods block/unblock your reading thread via a lock/semaphore/etc.

Do not start a runloop in a block submitted to a dispatch queue. You do not own the thread that your block is executing on, therefore you should not mutate thread state. For all you know, if you dispatch_async from a background thread, your block will execute on the main thread.

--Kyle Sluder
_______________________________________________

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: Thread synchronization via queue
      • From: Charles Srstka <email@hidden>
References: 
 >Thread synchronization via queue (From: Rick Mann <email@hidden>)
 >Re: Thread synchronization via queue (From: Charles Srstka <email@hidden>)
 >Re: Thread synchronization via queue (From: Rick Mann <email@hidden>)
 >Re: Thread synchronization via queue (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: Thread synchronization via queue
  • Next by Date: Re: Thread synchronization via queue
  • Previous by thread: Re: Thread synchronization via queue
  • Next by thread: Re: Thread synchronization via queue
  • Index(es):
    • Date
    • Thread