Multi-Thread Programming Guide [complete Chinese translation]-threading programming guide

Source: Internet
Author: User
Tags posix

[Old wolf recommendation] multi-thread programming guide
Original article: Threading programming guide
Link: http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Multithreading/Introduction/Introduction.html#//apple_ref/doc/uid/10000057i-CH1-SW1

PDF Document Download:
Multi-thread programming example (1427 K) Downloads: 3874

PS:
[Translation reason-translation itself is also a process of Reinforcement Learning]
I have been diving on cocoachina before. Although I have been developing IOS for almost two years, I always feel that something is missing. I used to view the API documentation in English, but I can't remember some details. One day someone complained to me that it was too painful to view the official English API documentation. Then I thought that if I translated some frequently-used official documents into Chinese, maybe it can help these people who need help, and then they even began their own entertaining translation journey. While helping others, you are also happy.

Multi-threaded programming is very helpful when developing applications. For example, you can load images in the background, update images in the main thread after they are loaded, or process some events that require a long CPU usage (such as the request server, load data ). We need to understand the advantages of multi-threaded programming, but also more practical practices, combined with the use of a variety of multi-threaded technology. Pay special attention to run
Many developers seldom pay attention to the run loop when writing multi-threaded applications. If you carefully read and grasp the details of the run loop, it will help you write better code. Synchronization is a commonplace in multi-thread programming. It is estimated that everyone in college is familiar with the importance of synchronization.

During the translation process, this article finds that many Chinese translations are obscure, so the free translation method is adopted. This inevitably leads to some discrepancies with the original article, if you find any errors during reading, you can send me an email:Xyl.layne@gmail.com

You can also pay attention to my weibo posts for communication and learning.
Weibo address:

Http://weibo.com/u/1826448972

Finally, I hope this document will help those who feel difficult to read the official English documents. If you can, I recommend that you view the original English documents as much as possible. After all, it is original and translation cannot avoid some omissions.

Coming soon: core data programming guide

Because the translation is written in word, the format is too large, so it is difficult to upload images, so we can directly convert them to PDF for you to download.

Directory preview is provided as follows:

Directory

Multi-Thread Programming Guide
Introduction
Structure of this document
Chapter 1 multi-thread programming
1.1 What is Multithreading
1.2 thread terminology
1.3 multi-thread substitution
1.4 thread support
1.4.1 thread package
1.4.2 run Loops
1.4.3 synchronization Tool
1.4.4 inter-thread Communication
1.5 design skills
1.5.1 avoid explicit thread Creation
1.5.2 keep your thread busy reasonably
1.5.3 avoid sharing data structures
1.5.4 multithreading and your user interface
1.5.5 understand the thread exit Behavior
1.5.6 handling exceptions
1.5.7 interrupt your thread cleanly
1.5.8 thread-safe Library
Chapter 2 thread management
2.1 thread cost
2.2 create a thread
2.2.1 use nsthread
2.2.2 use POSIX Multithreading
2.2.3 use nsobject to generate a thread
2.2.4 use other Thread Technology
2.2.5 use POSIX Threads on the cocoa Program
2.3 configure thread attributes
2.3.1 configure the thread stack size
2.3.2 configure local thread storage
2.3.3 set the thread disconnection status
2.3.4 set the thread priority
2.4 compile the main point of your thread
2.4.1 create an automatic release pool)
2.4.2 set Exception Handling
2.4.3 set a run Loop
2.5 interrupt thread
Chapter 3 run Loops
3.1 run Loop Profiling
3.1.1 run loop mode
3.1.2 Input Source
3.2 When to use run Loop
3.3 Use the run loop object
3.3.1 get the run loop object
3.3.2 configure run Loop
3.3.3 start run Loop
3.3.4 exit the run Loop
3.3.5 thread security and run loop object
3.4 configure the source of the run Loop
3.4.1 custom Input Source
3.4.2 configure the timing Source
3.4.3 configure a port-based Input Source
Chapter 4 Thread Synchronization
4.1 synchronization Tool
4.1.1 atomic operation
4.1.2 memory barrier and volatile Variables
4.1.3 lock
4.1.4 Conditions
4.1.5 execute selector routine
4.2 synchronization cost and performance
4.3 thread security and semaphores
4.4 thread security design skills
4.4.1 completely avoid Synchronization
4.4.2 understand synchronization restrictions
4.4.3 threats to code correctness
4.4.4 beware of deadlocks and livelocks)
4.4.5 correct use of volatile Variables
4.5 Use atomic operations
4.6 use locks
4.6.1 use POSIX mutex lock
4.6.2 use nslock class
4.6.3 use the @ synchronized command
4.6.4 use other cocoa locks
4.7 conditions of use
4.7.1 Use nscondition class
4.7.2 POSIX Conditions
Appendix A: thread security Summary
Cocoa
Thread security of the Basic Framework (Fondation Framework)
Thread security of application KIT framework
Core data framework
Core Foundation (core framework)
Glossary
Conclusion
Recommended Resources

PDF Document Download:
Multi-thread programming example (1427 K) Downloads: 3874

Recommended resources:

Core animation Programming Guide [core animation Programming Guide]
:
Http://www.cocoachina.com/bbs/read.php? Tid = 84461 & fpage = 3

Blocks programming highlights [blocks programming topics]
:
Http://www.cocoachina.com/bbs/read.php? Tid = 87593

Instruments User Guide]
:
Http://www.cocoachina.com/bbs/read.php? Tid = 92026

Local and push notification Programming Guide [local and push notification Programming Guide]
:
Http://www.cocoachina.com/bbs/read.php? Tid = 98797

Core data programming guide [core data programming guide]
: [Coming soon, stay tuned to Weibo news]

Source Address:

Http://www.cocoachina.com/bbs/read.php? Tid = 87592

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.