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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:58:07+00:00 2026-06-11T01:58:07+00:00

Regarding IOS global queue, it is a good idea and we can use it

  • 0

Regarding IOS global queue, it is a good idea and we can use it to leverage multi-core CPU by sub-threads, but current now my question is how to manage these sub thread after it has been dispatched from queue? Seems Apple doesn’t provide such API.

For example, I create a serial queue, for the case one job is blocked dues to some reason then the whole queue will also be blocked. In fact we want to manage this job, current now seems no t method found.

Any discussion will be appreciated, thanks in advance.

  • 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-11T01:58:08+00:00Added an answer on June 11, 2026 at 1:58 am

    Once a block is dispatched to a queue, it will execute. There is no API to prevent it.

    You can suspend the queue, which will cause pending blocks to not executed until the queue is resumed. However, there is no way to stop blocks.

    The conventional method is to have a “check” in you code to see if the running block should stop early.

    // return early from block
    if (shouldStop) return;
    

    Note, that what you see as a “problem” is the exact definition of a serial queue. It only allows operations to process in the order in which they are submitted to the queue. You have to wait for the ones ahead of you to complete.

    You can also check out NSOperationQueue which provides an easier mechanism for canceling blocks that are waiting in the queue, but the only way to stop a block that is executing is for you to implement that mechanism in your block.

    If you find that you have to cancel lots of “blocking” blocks, then your design is most likely flawed, and you need to revisit your design.

    Furthermore, if the tasks that are “behind” the one that is waiting really do not need to wait for that task, then why are you placing them behind it in a serial queue? Use a concurrent queue, or separate serial queues, or some other mechanism.

    Now, let me state that you should really not use dispatch queue for blocking I/O operations. You can do it, and often it’s the easiest, but if you want the best performance characteristics for your app, you should use dispatch_io which will integrate better with other CPU intensive threads.

    I guess the big takeaway here should be that instead of trying to get an answer to something like “How do I run a block on a serial queue when the block currently running is blocked?” you should be asking yourself how you can better design your application so that you do not have this scenario.

    If the work does not have to be executed, then don’t wait for it. If the work has to be completed, they you just have to wait…

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

Sidebar

Related Questions

My iOS Application has been in review, but was rejected regarding the iOS Data
Can anyone tell me where I can get more information regarding iOS architecture and
I'm adding an iOS App to iTunes Connect, but are confused regarding the two
I'm having trouble finding some good information regarding development with iOS 5 SDK /
I want to process audio offline on iOS, but have a query regarding memory
I'm a newbie of iOS development and I'm confused regarding universal app. We can
I have a question regarding iOS (or perhaps more accurately Objective-C) and properties. I
Hi I'm working through the Stanford iOS development class. I have a question regarding
I have been reading conflicting information about the use of #define macros in iOS
Regarding the regexp in TCL, if I use the following regexp: regexp helloworld\[\\s]+.name. to

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.