Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 999267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:19:29+00:00 2026-05-16T07:19:29+00:00

Here’s a slide from WWDC 2010 session 208: conn = [[NSURLConnection alloc] initWithRequest:req delegate:self

  • 0

Here’s a slide from WWDC 2010 session 208:

conn = [[NSURLConnection alloc] initWithRequest:req
  delegate:self startImmediately:NO];
[conn scheduleInRunLoop: [NSRunLoop currentRunLoop]
  forMode: NSDefaultRunLoopMode];
[conn start];

Are there any problems associated with putting multiple conn’s in the currentRunLoop?

What benefits does scheduling the NSURLConnection in a background thread’s runloop?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:19:30+00:00Added an answer on May 16, 2026 at 7:19 am

    Your use of the phrase “secondary runloop” suggests that you don’t know what a run loop is.

    An NSRunLoop is an implementation of a thread’s “main loop”. More or less,

    while ([runLoop waitNextEvent]) {
        NSAutoreleasePool * pool = [NSAutoreleasePool new];
        [runLoop handleEvent];
        [pool release]; pool = nil;
    }
    

    A run loop has a thread. Each thread has at most one run loop. “performSelectorOnMainThread” schedules it on the run loop, but programmers generally talk about threads rather than whatever run loop abstraction it’s using, since they’re all the same. Not all threads have run loops (NSThread’s functions will generally give you a thread with no run loop; I think you have to create the run loop yourself if you want one).

    “currentRunLoop” is the run loop of the currently executing thread. This is probably the main thread, unless you’ve used NSOperation/dispatch_*/etc. If you schedule it on another thread, then (I think) the delegate callbacks get run from another thread. You probably don’t want that to happen.

    Now, threads.

    There is little point spawning a background thread which is idle most of the time. NSURLConnection should to very little processing (you can’t get that much bandwidth into a phone in the first place); there’s practically no overhead associated with running it in the main run loop; threads tend to have much larger overheads.

    If you’re processing the data, and the processing is CPU-intensive, you might want it running in the background thread. You might put the connections in the background thread, but in general it’s easier to do as much as possible in the main thread.

    And I won’t get started on inter-thread communication woes, because they’re a major pain. Only use concurrency if you know you need it.

    (And until the iPhone goes dual-core, you almost certainly don’t need it for 99% of the code you write.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 487k
  • Answers 487k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer use Module VERSION If the VERSION argument is present between… May 16, 2026 at 8:22 am
  • Editorial Team
    Editorial Team added an answer You have to requery and then notifyDataSetChanged. May 16, 2026 at 8:22 am
  • Editorial Team
    Editorial Team added an answer Transform the point to a coordinate frame aligned with the… May 16, 2026 at 8:22 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Related Questions

No related questions found

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.