• 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: NSRunloop + shared thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSRunloop + shared thread


  • Subject: Re: NSRunloop + shared thread
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 19 Nov 2009 16:51:01 -0800

On Nov 19, 2009, at 3:40 PM, Colin Deasy wrote:

> This shared thread is actually handling potentially large numbers of concurrent url connections/downloads. The reason that I want a block in some of those at different times is a for a form of bandwidth control I am trying to do.

I don't think that will do what you want. The actual socket I/O happens in a background thread owned by CFNetwork; I don't think that thread will stop reading data just because your callback on the main thread hasn't returned yet. It just means that, when you do return, you'll immediately get a bigger chunk of data.

I've seen this general question of rate limiting asked on the macnetworkprog list. IIRC the answer is that Foundation and CFNetwork don't really give you the tools to do it. You'd have to write your own code using low-level BSD sockets APIs. :-P

—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: NSRunloop + shared thread
      • From: "Hank Heijink (Mailinglists)" <email@hidden>
References: 
 >NSRunloop + shared thread (From: Colin Deasy <email@hidden>)
 >Re: NSRunloop + shared thread (From: Jens Alfke <email@hidden>)
 >RE: NSRunloop + shared thread (From: Colin Deasy <email@hidden>)

  • Prev by Date: Re: tiffs on pasteboard
  • Next by Date: Re: Advice about crash requested
  • Previous by thread: Re: NSRunloop + shared thread
  • Next by thread: Re: NSRunloop + shared thread
  • Index(es):
    • Date
    • Thread