您的位置:首页 > 移动开发 > Objective-C

Concurrent Programming 2: Concurrent Programming with Objective-C

2013-11-24 21:25 176 查看

Concurrent Programming with Objective-C

Now that you understand some of the key issues regarding concurrent programming, you can begin to explore the mechanisms available to implement concurrent programming in Objective-C.
This ranges from language features to APIs and system services, and includes the following:

Language features: The Objective-C language includes several language features to support concurrent programming. The@synchronized directive
is used to create locks in Objective-C code. Thread-safe access to Objective-C properties can be specified declaratively using the atomic property
qualifier.
Message passing: The Foundation Framework NSObject class
includes several methods that deliver messages to other threads. These methods queue the messages on the run loop of the target thread and can be performed synchronously or asynchronously.
Threads: The Foundation Framework provides a complete set of APIs for directly creating and managing threads. It also
includes a set of Foundation Framework APIs for performing synchronized access to data shared by multiple threads.
Operation queues: These
are Objective-C based message-passing mechanisms that utilize an asynchronous design approach to perform concurrent programming.
Dispatch queues: These are a C-based
set of language features and runtime services used to perform tasks asynchronously and concurrently.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: