• 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: Can I create a thread with a runloop and a dispatch queue?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I create a thread with a runloop and a dispatch queue?


  • Subject: Re: Can I create a thread with a runloop and a dispatch queue?
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 03 Oct 2013 12:00:22 -0700

On Oct 3, 2013, at 11:46 AM, Kyle Sluder <email@hidden> wrote:

> There is magic sauce in CFRunLoop that runs the main queue as part of
> processing the runloop. All other queues are managed by code running on
> a thread managed by libdispatch. The main queue is a special case; it
> doesn't make sense for this relationship to exist for other queues.

Why doesn’t it make sense?

A runloop is conceptually very much like a serial dispatch queue. Both are mechanisms for handling incoming requests/calls/events in order. Why are the two divorced, except for the special case of the main thread?

I think this would fix some current problems. For example, dispatch_get_current_queue is deprecated, and the only reason I can think of is that it may return NULL if the caller isn’t running under the control of a dispatch queue. If threads with runloops had dispatch queues, then dispatch_get_current_queue would work correctly in this very common case, making it more reliable.

—Jens
_______________________________________________

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: Can I create a thread with a runloop and a dispatch queue?
      • From: Mike Abdullah <email@hidden>
References: 
 >Re: Can I create a thread with a runloop and a dispatch queue? (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Can I create a thread with a runloop and a dispatch queue?
  • Next by Date: Re: Can I create a thread with a runloop and a dispatch queue?
  • Previous by thread: Re: Can I create a thread with a runloop and a dispatch queue?
  • Next by thread: Re: Can I create a thread with a runloop and a dispatch queue?
  • Index(es):
    • Date
    • Thread