简体   繁体   English

GCD并发队列具有相同优先级的操作?

[英]GCD concurrent queue with operations of same priority?

I know that GCD has serial and concurrent queues. 我知道GCD有串行和并发队列。

I also aware of the fact that serial queues execute in FIFO manner, and that concurrent queues according to priority and availability of threads. 我还知道以下事实:串行队列以FIFO方式执行,并发队列根据线程的优先级和可用性而定。

I am not able to find any description of what's happening in concurrent queues with operations of same priority. 我无法找到具有相同优先级操作的并发队列中发生的情况的任何描述。

Do they execute in FIFO manner as every operation has the same priority? 它们是否以FIFO方式执行,因为每个操作都具有相同的优先级?

Can anybody help me in finding out this? 有人可以帮助我找出答案吗?

From the GCD reference : GCD参考资料

Concurrent: tasks are dequeued in FIFO order, but run concurrently and can finish in any order. 并发:任务按FIFO顺序出队,但同时运行,并且可以按任何顺序完成。

So tasks submitted to a particular queue will be dequeued in FIFO order. 因此,提交到特定队列的任务将按FIFO顺序出队。 Tasks submitted to a GCD queue do not have a priority relative to one another, only the queue has a quality of service (QoS) value. 提交给GCD队列的任务没有彼此的优先级,只有队列具有服务质量(QoS)值。

If you are asking about tasks submitted to different queues where the queues have the same QoS value, then the order of execution is not defined beyond tasks being executed in FIFO order within their own queue. 如果您要询问的任务是提交给队列中具有相同QoS值的不同队列的任务,那么除了在其自己的队列中按FIFO顺序执行的任务外,执行顺序没有定义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM