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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:04:22+00:00 2026-06-15T02:04:22+00:00

I am using the following code for nsoperation.The problem is all three tasks run

  • 0

I am using the following code for nsoperation.The problem is all three tasks run serially.What can I do to make the tasks run in parallel.I tried implementing the start and isconcurrent methods but it doesnt work.please help…
Given is my uaview controller class

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    Store *S=[ [Store alloc] init];
    S.a=25;

    NSOperationQueue *someQueue = [NSOperationQueue currentQueue];

    someQueue.MaxConcurrentOperationCount = 3;

    NSInvocationOperation *invocationOp2 = [[NSInvocationOperation alloc]  initWithTarget:self
                                                                                 selector:@selector(ymain)
                                                                                   object:nil];

    NSInvocationOperation *invocationOp3 = [[NSInvocationOperation alloc]  initWithTarget:self
                                                                                 selector:@selector(ymain2)
                                                                                   object:nil];
    NSInvocationOperation *invocationOp4 = [[NSInvocationOperation alloc]  initWithTarget:self
                                                                                 selector:@selector(ymain3)
                                                                                   object:nil];


    [someQueue addOperation:invocationOp2];
    [someQueue addOperation:invocationOp3];
    [someQueue addOperation:invocationOp4];




}
-(void)ymain
{





    for (int i = 0 ; i < 10000 ; i++) {
        NSLog(@"in the A main");    }
}

This is the other class which was subclassed

@interface A : NSOperation

@end

@implementation A

bool executing;
bool finished;
-(void)main
{

}
- (BOOL)isConcurrent
{
    return YES;
}

- (BOOL)isReady
{
    return YES;
}
  • 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-15T02:04:23+00:00Added an answer on June 15, 2026 at 2:04 am

    currentQueue is returning the main queue, which is a serial queue that executes on the main runloop. You should create your own NSOperationQueue to run the operations concurrently.

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

Sidebar

Related Questions

Just run into a tricky NSFetchedResultsController problem. The following code works fine in all
I am using following code to attach my database to SQL Server. The problem
I am using following code to make a phone call from my iPhone app:
I am using following code to connect with WPA2 in android (I can connect
I am using following code in my ccnet.config file <tasks> <conditional> <conditions> <compareCondition> <value1>${Target1}</value1>
Iam Using following code to run this event using IF CURRENT_TIME() = '23:50:00' But
I am using following code to make a call. private void callBack(String phone, Context
i am using following code to delete all files in one folder that consist
I am using following code for notification. It should vibrate and make sound at
im using following code to send sms to all the students in the database

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.