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

  • Home
  • SEARCH
  • 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 7753179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:59:23+00:00 2026-06-01T11:59:23+00:00

1)I am creating a ios app in which I have to scan a pool

  • 0

1)I am creating a ios app in which I have to scan a pool of IP address. Each one can take time , so I want to implement multithread in my app.
I was about to use thread class but I have doubts regarding that how many threads we can create simuntaneoulsy. Its mentioned in developer.apple guide that each thread would take 512KB memory. So, wouldnt that make my app hang , suppose I create 100 threads or may be more that that ?

2) one doubt regarding threading:do each thread create their own object(to operate) when I pass same object to all threads.Actually,They all are performing same task
3)if I go for GCD(grand central dispatch) then do I have any advantage ? ie would that help me in this particular situation.

3)Also, one last thing. what would be the best way to perform a task which are similar but need to perform concurrently(in order to improve performance). Note:
All these threads use same object method to perform task.

Thanks and regards , if i sound weird

  • 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-06-01T11:59:25+00:00Added an answer on June 1, 2026 at 11:59 am

    IMO, the simplest thing to do is perform your scan in a single thread (or a single block that is dispatch_async’d) and then use a kqueue to deal with the results efficiently. The kqueue API takes a little getting used to but is an efficient way to do what you want. The basic idea is:

    1. create a kqueue
    2. create non-blocking sockets
    3. call connect on each socket
    4. add the sockets to your kqueue such that it will wake your thread up when a connection succeeds or times out. man kqueue for details how to do this.
    5. in a loop, call kevent. This will block until you kqueue matches an event you’re waiting for (timeout or connection succeeded). Exit your thread when there are no sockets left to monitor.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are creating an ios app, In which we want to use certain interactive
I am currently creating an iOS app, which connects to a database and asynchronously
I'm creating an app that tracks your elevation. Currently IOS is one of the
Creating an iOS app in Flash Builder 4.5 which is a small Hello World
I've been tasked with creating an IM app for IOS. I currently have an
I am creating ios app in xcode 4.2. I have outside file with database.
I'm creating iOS app that has a label. I want to set two colors.
I'm creating an iOS app who will have to stop the standby timer. I
I have an app in Flash CS5 that I am creating for iOS. I
I have two svn repositories, one each for the iOS and Android versions of

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.