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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:32:28+00:00 2026-06-10T02:32:28+00:00

i want to render 30 different images. Each task has to merge different image

  • 0

i want to render 30 different images. Each task has to merge different image layers to just one final image- 30 final images.

Currently i use a GCD serial queue. Now i want to know if this approach uses the CPU power of all available cores automatically?

Or can i improve the rendertime for all these tasks when using a GCD concurrent queue instead?
Thanks for clarification..

  • 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-10T02:32:30+00:00Added an answer on June 10, 2026 at 2:32 am

    Serial queue = 1 task = 1 core. But the real problem in your use case is I/O contention. What happens if you spawn a concurrent queue to read from one resource? you end up with the CPU(s) sitting idle on each block while they take turns reading the disk. GCD reacts to idle CPU increasing the thread pool. In this case that results in too many threads and even more contention.

    The solution is to use dispatch_io functions for the reading, and do the image processing on a different concurrent queue, which will be free to grow as needed.

    dispatch_queue_t imageProcessing = dispatch_queue_create("com.yourReverseDomainHere", DISPATCH_QUEUE_CONCURRENT);
    
    for (NSURL *url in ...){
        dispatch_io_t io = dispatch_io_create_with_path(DISPATCH_IO_RANDOM,[[url path] fileSystemRepresentation], O_RDONLY, 0, NULL, NULL);
        dispatch_io_set_low_water(io, SIZE_MAX);
        dispatch_io_read(io, 0, SIZE_MAX, dispatch_get_main_queue(),^(bool done, dispatch_data_t data, int error){
    
            // convert the file from dispatch_data_t to NSData
            const void *buffer = NULL;
            size_t size = 0;
            dispatch_data_t tmpData = dispatch_data_create_map(data, &buffer, &size);
            NSData *nsdata = [[NSData alloc] initWithBytes:buffer length:size];
            dispatch_release(tmpData);
            free(buffer);
    
            // send this nsdata elsewhere for processing
            dispatch_async(imageProcessing, ^{
                // ...image processing code...
            });
    
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to render one of these sets of views: head body-$id1 foot OR
I want to render same template on one page which should display the value
I am having layout which I want to render on to different sizes of
I am using gridview example with image adapter to render images with difference that
I want to use Smarty to render my CSS file, mainly so I can
I have a different subheader partial I want to render dependent on where I'm
I want to render the partial view using ajax. When I submit the button,
I want to render a profile user container that contains a list of labels
I want to render for facebook bot special data. I have og.html.erb <!DOCTYPE html><html><head>
I want to render equations to PNG files and embed them in the HTML

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.