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 8042603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:38:27+00:00 2026-06-05T04:38:27+00:00

Guys I need some help to architect my multithreading in iOS. I’m using ARC

  • 0

Guys I need some help to architect my multithreading in iOS.

I’m using ARC in my code.

So basically I need following,

In my main thread nstimer fire some method which should be executed in a separate thread, that thread does some calculation and puts data into some ivar, and another thread should read data from that ivar and do some other calculation, i.e. if there is no data the second thread should wait until there is any.

So basically I would like to hear some advice which technology is the best choice for my task, to use cocoa thread (NSThread), GCD or Operation queues.

Also can someone please provide me with some pseudo code on aspects of mutual blocking/synchronization between two threads.

  • 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-05T04:38:29+00:00Added an answer on June 5, 2026 at 4:38 am

    Unless you left something our of your problem description, that is a perfect fit for GCD/block combo. In fact, I wouldn’t even use a NSTimer (GCD provides a better alternative – see dispatch_source_create for example of creating GCD based timer), but that’s your call, and not what the question asked. Anyway, with GCD…

    - (void)handleTimer:(NSTimer *)timer {
        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
            __block id someObject;
            // Do work...  manipulate someObject in some manner...
            // When done, invoke other thread... main thread in this case
            dispatch_async(dispatch_get_main_queue(), ^{
                // This code is running in a different thread, and can use someObject directly
            });
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one jQuery code and need some help from u guys to improve
Hey guys! I need some help writing a code that creates an array in
Hey Guys I would very much appreciate some help with the following. We're using
What's up guys! I gonna need some help! Inside of this code return ControllTheDog(D,
I have a minor problem guys which I need some help. I have a
Guys i need some help here , im getting this error here at the
Alright guys, Need some help! Im working with asp.net mvc3 razor (and am fairly
Hi guys I need some help with Apple App Store. I've an application that
hi all i need some help from you guys.. well here's the description Guys
I am working on an iPad application and need some help from you guys.

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.