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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:57:11+00:00 2026-06-11T21:57:11+00:00

I have a run loop method for a CAEAGLLayer which uses GCD for serializing

  • 0

I have a run loop method for a CAEAGLLayer which uses GCD for serializing access to shared ivars.

My drawing code currently is constructed like this:

- (void)draw {
    dispatch_sync(serialDrawingQueue, ^{
        @autoreleasepool {
            [self drawingStart];

            [spriteA draw];
            [spriteB draw];

            [self drawingEnd];
        }
    });
}

The draw method is called by a CADisplayLink.
Is the @autoreleasepool necessary when I use GCD blocks?

  • 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-11T21:57:13+00:00Added an answer on June 11, 2026 at 9:57 pm

    From the Apple docs:

    If your block creates more than a few Objective-C objects, you might
    want to enclose parts of your block’s code in an @autorelease block to
    handle the memory management for those objects. Although GCD
    dispatch queues have their own autorelease pools
    , they make no
    guarantees as to when those pools are drained. If your application is
    memory constrained, creating your own autorelease pool allows you to
    free up the memory for autoreleased objects at more regular intervals.

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

Sidebar

Related Questions

I have this class in which I run a for loop 10 times. This
How to run multiple dos commands? I have a for loop, which runs detection
gurus. I have a perl script which needs to run in an infinite loop
I have a method called inside a button that run almost an infinite loop.
I have to loop in particluar method which do some task. I have used
I have run across this method in our code base and wonder what the
Background Currently I have a C# Silverlight business application which uses RIA Services. The
I have a nice dataset loop working, but I need to run another loop
I have a for loop I'd like to run in bash like: for i
I have rm -i inside a for loop but when I run it, it

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.