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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:48:24+00:00 2026-06-09T17:48:24+00:00

I have a process that I’m trying to create where I download different xml

  • 0

I have a process that I’m trying to create where I download different xml files and parse them from a website. At the moment I can get them to all work by using…

dispatch_async(dispatch_get_current_queue(),^ { [self updatePersons]; });
dispatch_async(dispatch_get_current_queue(),^ { [self updatePlaces]; });
dispatch_async(dispatch_get_current_queue(),^ { [self updatePositions]; });
dispatch_async(dispatch_get_current_queue(),^ { [self updateContacts]; });

This locks up the main thread because I’m using dispatch_get_current_queue. How can I get these to execute without interrupting each other which seems to be the case when trying the method below.

dispatch_async(dispatch_get_global_queue(0,0),^ { [self updatePersons]; });

The full version of my code I’m using is below, but what happens according to my Log output is they execute at the same time (which I get is kinda the purpose if I understand everything right); however, the code for them never really finishes… I cannot tell if everything is getting parsed or not through the Log Output and the main screen stays frozen. The log only shows part of the logs it should be showing… seems to be interrupted by the other process’s NSLog messages.

dispatch_async(dispatch_get_global_queue(0,0),^ { [self updatePersons]; });
dispatch_async(dispatch_get_global_queue(0,0),^ { [self updatePlaces]; });
dispatch_async(dispatch_get_global_queue(0,0),^ { [self updatePositions]; });
dispatch_async(dispatch_get_global_queue(0,0),^ { [self updateContacts]; });

dispatch_async(dispatch_get_global_queue(-2,0),^ { 

            dispatch_async(dispatch_get_main_queue(),^  {[self setBottomBarToUpdated]; });
 });

I’m trying to create a way for the app to pull down the information through each of the functions above, while updating the user on the progress while it’s executing by a label on the bottom bar. I have the updating the text working fine it seems by using the below code in each of the four functions…

dispatch_async(dispatch_get_main_queue(),^ {
         [self setBottomBarToUpdating:@"Updating Places..."];
});

If anyone can offer help to the proper way to use the queues so my app doesn’t lock up I’d greatly appreciate it. Thanks!

  • 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-09T17:48:26+00:00Added an answer on June 9, 2026 at 5:48 pm

    If you create you own private concurrent dispatch queue, then you can use a “barrier block”. This block will be executed only when all other previously submitted blocks are finished.

    dispatch_queue_t queue = dispatch_queue_create("myQueue", DISPATCH_QUEUE_CONCURRENT);
    
    // These blocks are executed concurrently:
    dispatch_async(queue, ^ { [self updatePersons]; });
    dispatch_async(queue, ^ { [self updatePlaces]; });
    // ...
    
    dispatch_barrier_async(queue, ^ {
        // This will be executed when all previous blocks are finished.
        dispatch_async(dispatch_get_main_queue(), ^{
            [self setBottomBarToUpdated];
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a process that gets a files from a directory and puts them
I have Process objects that are monitored from two different views. A Windows.Forms.ListView (actually
We have a process that I'm trying to automate in which I have to
i have a process that downloads a file from a webbrower. it has the
I have a process that uses a lot of memory mapped files. Problem is
I have a process that sends to printer a large amount of .doc files
I have a process that's going to initially generate 3-4 million PDF files, and
I have a process that modifies icons on files with an overlay. The Finder,
I have a process that extracts customer info from multiple databases (MySql) based on
I have a process that extracts customer info from multiple databases (MySql) based on

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.