Provides a task queue that can perform tasks either synchronously or asynchronously.
public sealed class DispatchQueue : CoreFoundation.DispatchObject
type DispatchQueue = class inherit DispatchObject
Queues are the fundamental mechanism for scheduling blocks for execution within the Apple Grand Central Dispatch framework.
All blocks submitted to dispatch queues are dequeued in FIFO order. By default, queues created with the default constructor wait for the previously dequeued block to complete before dequeuing the next block. This FIFO completion behavior is sometimes simply described as a "serial queue." Queues are not bound to any specific thread of execution and blocks submitted to independent queues may execute concurrently. Queues, like all dispatch objects, are reference counted and newly created queues have a reference count of one.
Concurrent dispatch queues are created by passing
true as the value for the concurrent parameter on
the constructor. Concurrent queues may invoke blocks
concurrently (similarly to the global concurrent queues, but
potentially with more overhead), and support barrier blocks
submitted with the dispatch barrier API, which e.g. enables
the implementation of efficient reader-writer schemes.
The optional label argument is used to describe the purpose of the queue and is useful during debugging and performance analysis. By convention, clients should pass a reverse DNS style label. If a label is provided, it is copied. If a label is not provided, then Label property returns an empty C string. For example:
var my_queue = new DispatchQueue ("com.example.subsystem.taskXYZ");
Dispatch queue is
Dispatch Barrier API
The dispatch barrier API is a mechanism for submitting barrier blocks to a dispatch queue, analogous to the DispatchAsync(Action)/DispatchSync(Action) methods. It enables the implementation of efficient reader/writer schemes. Barrier blocks only behave specially when submitted to concurrent queues ; on such a queue, a barrier block will not run until all blocks submitted to the queue earlier have completed, and any blocks submitted to the queue after a barrier block will not run until the barrier block has completed. When submitted to a a global queue or to a non-concurrent queue, barrier blocks behave identically to blocks submitted with the DispatchAsync(Action)/DispatchSync(Action) methods.
Surfaces an unmanaged DispatchQueue as a managed object.
Creates a named dispatch queue that serializes all submitted blocks.
|DispatchQueue(String, Boolean) DispatchQueue(String, Boolean)||
Creates a named dispatch queue that can optionally execute any submitted code concurrently.
User defined context information attachech to a DispatchQueue.
Developers should not use this deprecated property.
Label for the current queue.
Returns the default global queue, which is one of the built-in queues at the default priority.
Handle (pointer) to the unmanaged object representation.(Inherited from DispatchObject)
Returns the label for this DispatchQueue.
Returns the main global queue.
|Equality(DispatchQueue, DispatchQueue) Equality(DispatchQueue, DispatchQueue)|
|Inequality(DispatchQueue, DispatchQueue) Inequality(DispatchQueue, DispatchQueue)|
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.