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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:42:49+00:00 2026-06-16T02:42:49+00:00

I want to execute an NSOperation synchronously on the currently executing thread. Can I

  • 0

I want to execute an NSOperation synchronously on the currently executing thread. Can I just call [NSOperation start]? Does this always run in the currently executing thread?

An alternative is to just create an NSOperationQueue, add the operation then call waitUntilAllOperationsFinished selector.

  • 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-16T02:42:51+00:00Added an answer on June 16, 2026 at 2:42 am

    If you call [NSOperation start], it will execute synchronously on the current thread. All the asynchronous work surrounding operations is handled by NSOperationQueue, but if you’re calling -start yourself then you’re bypassing all of that.

    Of course, a particular NSOperation subclass may be implemented to spawn off an asynchronous task itself on another thread; that’s entirely up to it. But an operation that’s designed to execute synchronously in whatever thread the operation queue runs it in, will also execute synchronously in your thread if you call -start.


    For example, the following code, when run:

    NSOperation *op = [NSBlockOperation blockOperationWithBlock:^{
        NSLog(@"operation");
    }];
    [op start];
    NSLog(@"complete");
    

    prints:

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

Sidebar

Related Questions

I want to execute multiple thread side by side. ex: There will be a
I want to run a SELECT statement and I want execute a DELETE statement
I want to execute a command line tool to process data. It does not
I want to execute a code snippet when program start-up, so what is the
I want to execute a C program automatically during the start-up process. My C
I want to execute few functions before the page just exits such as logging
I want to execute this java script on load, but it doesn't seem to
I want to execute a piece of code So that users can pay attention
I want to execute this command mysql -u root -e source F:\dump.sql How do
I want to execute method: bar() when method foo() is done. This could be

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.