0%

Concurrency Programming Guide:术语表

程序 application

A specific style of program that displays a graphical interface to the user.

一种特定风格的向用户显示图形界面的program


异步设计法 asynchronous design approach

The principle of organizing an application around blocks of code that can be run concurrently with an application’s main thread or other threads of execution. Asynchronous tasks are started by one thread but actually run on a different thread, taking advantage of additional processor resources to finish their work more quickly.

围绕可与程序主线程或其他执行线程同时运行的block来组织程序的原则。异步任务由一个线程启动,但实际上在不同的线程上运行,利用额外的处理器资源,更快完成工作。


block object

A C construct for encapsulating inline code and data so that it can be performed later. You use blocks to encapsulate tasks you want to perform, either inline in the current thread or on a separate thread using a dispatch queue. For more information, see Blocks Programming Topics.

一种C结构,用于封装内联代码和数据,以便以后执行。你可以使用block来封装你想执行的任务,可以在当前线程中内联,也可以在一个单独的线程中使用调度队列。了解更多信息,可参阅Blocks Programming Topics


并发操作 concurrent operation

An operation object that does not perform its task in the thread from which its start method was called. A concurrent operation typically sets up its own thread or calls an interface that sets up a separate thread on which to perform the work.

一个操作对象,它不在调用其start方法的线程中执行其任务。一个并发操作通常会设置自己的线程,或者调用一个接口,设置一个单独的线程来执行工作。


条件 condition

A construct used to synchronize access to a resource. A thread waiting on a condition is not allowed to proceed until another thread explicitly signals the condition.

一个用于同步访问资源的结构。在一个条件下等待的线程不允许继续进行,直到另一个线程明确发出条件信号。


关键部分 critical section

A portion of code that must be executed by only one thread at a time.

一次只能由一个线程执行的部分代码。


自定义源 custom source

A dispatch source used to process application-defined events. A custom source calls your custom event handler in response to events that your application generates.

一个用于handler定义的事件的调度源。自定义源调用自定义事件handler,以响应程序产生的事件。


描述符 descriptor

An abstract identifier used to access a file, socket, or other system resource.

用于访问文件、套接字或其他系统资源的一个抽象标识符。


调度队列 dispatch queue

A Grand Central Dispatch (GCD) structure that you use to execute your application’s tasks. GCD defines dispatch queues for executing tasks either serially or concurrently.

一个GCD数据结构,用它来执行程序的任务。GCD定义了用于串行或并发执行任务的调度队列。


调度源 dispatch source

A Grand Central Dispatch (GCD) data structure that you create to process system-related events.

一个GCD数据结构,创建它来处理系统相关事件。


描述符调度源 descriptor dispatch source

A dispatch source used to process file-related events. A file descriptor source calls your custom event handler either when file data is available for reading or writing or in response to file system changes.

一个用于处理文件相关事件的调度源。文件描述符源在文件数据可供读写时或在文件系统变化时调用自定义事件处理器。


动态共享库 dynamic shared library

A binary executable that is loaded dynamically into an application’s process space rather than linked statically as part of the application binary.

一个二进制可执行文件,它被动态加载到程序的进程空间,而不是作为程序二进制的一部分静态链接。


framework

A type of bundle that packages a dynamic shared library with the resources and header files that support that library. For more information, see Framework Programming Guide.

一种捆绑类型,将动态共享库与支持该库的资源和头文件打包。更多信息,可参阅Framework Programming Guide


全局调度队列 global dispatch queue

A dispatch queue provided to your application automatically by Grand Central Dispatch (GCD). You do not have to create global queues yourself or retain or release them. Instead, you retrieve them using the system-provided functions.

由GCD自动提供给程序的一个调度队列。你不需要自己创建全局队列,也不需要保留或释放它们。相反,你可以使用系统提供的函数来检索它们。


Grand Central Dispatch (GCD)

A technology for executing asynchronous tasks concurrently. GCD is available in OS X v10.6 and later and iOS 4.0 and later.

一种用于并发执行异步任务的技术。GCD在OS X v10.6及以后版本和iOS 4.0及以后版本中可用。


输入源 input source

A source of asynchronous events for a thread. Input sources can be port based or manually triggered and must be attached to the thread’s run loop.

一个线程的异步事件的来源。输入源可以是基于端口的,也可以是手动触发的,必须连接到线程的run loop。


可连接线程 joinable thread

A thread whose resources are not reclaimed immediately upon termination. Joinable threads must be explicitly detached or be joined by another thread before the resources can be reclaimed. Joinable threads provide a return value to the thread that joins with them.

一个线程,其资源在终止时不会被立即回收。可加入的线程必须明确地被分离或被另一个线程加入,然后才可以回收资源。可加入的线程为与之加入的线程提供一个返回值。

库 library

A UNIX feature for monitoring low-level system events. For more information see the kqueue man page.

一个UNIX功能,用于监控低级别的系统事件。更多信息可参阅 kqueue man page。


Mach port dispatch source

A dispatch source used to process events arriving on a Mach port.

一个用于处理到达Mach端口事件的调度源。


主线程 main thread

A special type of thread created when its owning process is created. When the main thread of a program exits, the process ends.

一个特殊类型的线程,在其所属的进程被创建时创建。当一个程序的主线程退出时,该进程就结束了。


互斥锁 mutex

A lock that provides mutually exclusive access to a shared resource. A mutex lock can be held by only one thread at a time. Attempting to acquire a mutex held by a different thread puts the current thread to sleep until the lock is finally acquired.

一个提供对共享资源的互斥访问的锁。一个互斥锁在同一时间只能由一个线程持有。试图获取一个由不同线程持有的互斥锁会使当前线程陷入休眠状态,直到最终获得该锁。


Open Computing Language (OpenCL)

A standards-based technology for performing general-purpose computations on a computer’s graphics processor. For more information, see OpenCL Programming Guide for Mac.

一种基于标准的技术,用于在计算机的图形处理器上进行通用计算。更多信息,可参阅OpenCL Programming Guide for Mac


操作对象 operation object

An instance of the NSOperation class. Operation objects wrap the code and data associated with a task into an executable unit.

NSOperation类的一个实例。操作对象将与一个任务相关的代码和数据包装成一个可执行的单元。


操作队列 operation queue

An instance of the NSOperationQueue class. Operation queues manage the execution of operation objects.

NSOperationQueue类的一个实例。操作队列管理操作对象的执行。


私有调度队列 private dispatch queue

A dispatch queue that you create, retain, and release explicitly.

自己明确创建、保留和释放的调度队列。


进程 process

The runtime instance of an application or program. A process has its own virtual memory space and system resources (including port rights) that are independent of those assigned to other programs. A process always contains at least one thread (the main thread) and may contain any number of additional threads.

一个程序或程序的运行时实例。一个进程有自己的虚拟内存空间和系统资源(包括端口权限),独立于分配给其他程序的资源。一个进程总是包含至少一个线程(主线程),并可能包含任何数量的附加线程。


进程调度源 process dispatch source

A dispatch source used to handle process-related events. A process source calls your custom event handler in response to changes to the process you specify.

用于处理与进程有关的事件的调度源。进程源在响应指定的进程的变化时调用自定义事件handler。


程序 program

A combination of code and resources that can be run to perform some task. Programs need not have a graphical user interface, although graphical applications are also considered programs.

一个代码和资源的组合,可以运行以执行一些任务。程序不需要有图形用户界面,尽管图形应用程序也被认为是程序。


可重入的 reentrant

Code that can be started on a new thread safely while it is already running on another thread.

当代码已经在一个线程上运行时,可以在另一个新的线程上安全启动。


run loop

An event-processing loop, during which events are received and dispatched to appropriate handlers.

一个事件处理的循环,在这个循环中,事件被接收并调度给适当的handler。


run loop mode

A collection of input sources, timer sources, and run loop observers associated with a particular name. When run in a specific “mode,” a run loop monitors only the sources and observers associated with that mode.

一个输入源、定时器源和run loop观察者的集合,与一个特定的名称相关联。当在一个特定的模式下运行时,一个run loop只监控与该模式相关的源和观察者。


run loop object

An instance of the NSRunLoop class or CFRunLoopRef opaque type. These objects provide the interface for implementing an event-processing loop in a thread.

NSRunLoop类或CFRunLoopRef不透明类型的实例。这些对象提供了在线程中实现事件处理循环的接口。


run loop observer

A recipient of notifications during different phases of a run loop’s execution.

在run loop执行的不同阶段,是通知的接收者。


信号量 semaphore

A protected variable that restricts access to a shared resource. Mutexes and conditions are both different types of semaphore.

一个受保护的变量,限制对共享资源的访问。互斥锁和条件都是不同类型的信号量。


信号 signal

A UNIX mechanism for manipulating a process from outside its domain. The system uses signals to deliver important messages to an application, such as whether the application executed an illegal instruction. For more information see the signal man page.

一种UNIX机制,用于从一个进程的域外操纵该进程。系统使用信号向程序传递重要信息,例如程序是否执行了非法指令。更多信息可参阅 signal man page。


信号调度源 signal dispatch source

A dispatch source used to process UNIX signals. A signal source calls your custom event handler whenever the process receives a UNIX signal.

用于处理UNIX信号的调度源。当进程收到UNIX信号时,信号源会调用自定义事件handler。


任务 task

A quantity of work to be performed. Although some technologies (most notably Carbon Multiprocessing Services) use this term differently, the preferred usage is as an abstract concept indicating some quantity of work to be performed.

一个要执行的工作数量。尽管一些技术(最明显的是Carbon多处理服务)以不同的方式使用这个术语,但首选的用法是作为一个抽象的概念,表示要执行的一些工作的数量。


线程 thread

A flow of execution in a process. Each thread has its own stack space but otherwise shares memory with other threads in the same process.

一个进程中的执行流。每个线程都有自己的堆栈空间,但在其他方面与同一进程中的其他线程共享内存。


定时器调度源 timer dispatch source

A dispatch source used to process periodic events. A timer source calls your custom event handler at regular, time-based intervals.

用于处理周期性事件的调度源。定时器源定期、基于时间的间隔调用自定义事件handler。

欢迎关注我的其它发布渠道