Pro Multithreading and Memory Management for iOS and OS X

Book description

If you want to develop efficient, smooth-running applications, controlling concurrency and memory are vital. Automatic Reference Counting is Apple's game-changing memory management system, new to Xcode 4.2. Pro Multithreading and Memory Management for iOS and OS X shows you how ARC works and how best to incorporate it into your applications. Grand Central Dispatch (GCD) and blocks are key to developing great apps, allowing you to control threads for maximum performance.

If for you, multithreading is an unsolved mystery and ARC is unexplored territory, then this is the book you'll need to make these concepts clear and send you on your way to becoming a master iOS and OS X developer.

  • What are blocks? How are they used with GCD?

  • Multithreading with GCD

  • Managing objects with ARC

Table of contents

  1. Title Page
  2. Contents at a Glance
  3. Contents
  4. About the Author
  5. About the Translator
  6. About the Technical Reviewers
  7. Acknowledgments
  8. Introduction
    1. Preface
    2. Who This Book Is For
  9. Chapter 1: Life Before Automatic Reference Counting
    1. Reference Counted Memory Management Overview
    2. Exploring Memory Management Further
    3. Implementing alloc, retain, release, and dealloc
    4. Apple’s Implementation of alloc, retain, release, and dealloc
    5. Autorelease
    6. Summary
  10. Chapter 2: ARC Rules
    1. Overview
    2. Reference Counting Mechanism Changes
    3. Ownership qualifiers
    4. Rules
    5. Property
    6. Array
    7. Summary
  11. Chapter 3: ARC Implementation
    1. __strong ownership qualifier
    2. __weak ownership qualifier
    3. __autoreleasing ownership qualifier
    4. __unsafe_unretained ownership qualifier
    5. Reference Count
    6. Summary
  12. Chapter 4: Getting Started with Blocks
    1. Blocks Primer
    2. Block Literal Syntax
    3. Block type variables
    4. Capturing automatic variables
    5. Summary
  13. Chapter 5: Blocks Implementation
    1. Under the Blocks’ Hood
    2. Capturing Automatic Variables
    3. Writable Variables
    4. Memory Segments for Blocks
    5. Memory Segments for __block Variables
    6. Capturing Objects
    7. __block Variables and Objects
    8. Circular Reference with Blocks
    9. Copy/Release
    10. Summary
  14. Chapter 6: Grand Central Dispatch
    1. Grand Central Dispatch Overview
    2. Multithreaded Programming
    3. Summary
  15. Chapter 7: GCD Basics
    1. Dispatch Queues
    2. Obtaining Dispatch Queues
    3. Controlling Dispatch Queues
    4. Dispatch I/O
    5. Summary
  16. Chapter 8: GCD Implementation
    1. Dispatch Queue
    2. Dispatch Source
    3. Example Using Dispatch Source
    4. Summary
  17. Appendix A: Example of ARC, Blocks, and GCD
  18. Appendix B: References
    1. References for ARC
    2. References for Blocks
    3. References for Grand Central Dispatch
  19. Index

Product information

  • Title: Pro Multithreading and Memory Management for iOS and OS X
  • Author(s):
  • Release date: April 2012
  • Publisher(s): Apress
  • ISBN: 9781430241164