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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:15:02+00:00 2026-05-25T12:15:02+00:00

I have three tasks: A fetch task. It fetches objects (around 2000 of them)

  • 0

I have three tasks:

  1. A fetch task. It fetches objects (around 2000 of them) from CoreData and passes the NSManagedObjectIDs to the main thread where they’re converted back to NSManagedObjects and stored in an NSArray. This task is of least priority.

  2. A computation task. This task iterates through those objects and calculates some values for the object. The values are stored as transient attributes of the NSManagedObject subclass. This task is the 2nd highest priority.

  3. An OpenGL ES Drawing Task. This is the drawing loop that updates the UI based on the result of the computation task. This task is highest priority as any slow down will decrease the frame rate and be very apparent when zooming or panning.

My issue has been creating a design pattern that allows the first two tasks to do their work while still allowing the OpenGL task to run at maximum frame rate. What inevitably happens if I use GCD queues is that the OpenGL task will be blocked by one of the other two and it will stutter.

I’m thinking that I need to have the OpenGL thread operate on it’s own copy of the data, but I’m not sure what that looks like or even if it’s the correct solution. Has anyone dealt with this type of issue before? If so, how did you achieve both concurrency and performance?

  • 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-05-25T12:15:02+00:00Added an answer on May 25, 2026 at 12:15 pm

    For those who find this thread at a later point, here’s how I eventually solved the issue:

    • The fetch task runs in it’s own GCD queue and fetches the NSManagedObjects from CoreData. I created a new class that contains the computed properties for each of my objects. Using the fetched data, I instantiated an NSArray of these objects and passed them on to the compute task by dispatching a block operation in the compute queue.

    • The compute task runs in it’s own GCD queue and computes the values for each of these objects every second or two. After it’s finished, it passes on the NSArray to the drawing queue by dispatching a block in the drawing queue.

    • The drawing task runs in it’s own GCD queue and is asynchronous. All it does is loop through the objects and draws them.

    Basically, when one queue is finished operating on it’s data, it passes the data onto the next queue by dispatching a block in that queue. This prevents race conditions and solved the design pattern issues I was having. The only downside to this approach is that it does require a bit more memory. In my tests however, after a few optimizations, the memory usage is not all that bloated. Thanks to the various community inputs as I stumbled through this.

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

Sidebar

Related Questions

I have a table view that displays managed objects (Tasks). I'd like to fetch
I have three models: User, Task and Assignation. User has many tasks through assignation.
Task at hand — I have three versions of some code, developed by different
I have a backbone application which, upon load, needs to fetch data from four
Imagine I have two (three, four, whatever) tasks that have to run in parallel.
I am doing data fetch from net in an external task. Now this fetch
I have a service running, and one of its tasks is to regularly fetch
I currently have the below code to fetch data from my Entity framework model.
I have three tables, one is tasks which are tasks that factory workers complete
I'm useing MySQL and I have three tables, a table of tasks, a table

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.