生产者使用者队列

编程入门 行业动态 更新时间:2024-10-24 12:32:19
本文介绍了生产者使用者队列-线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我不清楚生产者使用者队列线程逻辑的操作.这是我的问题:如果生产者将任务发送到工作线程,而在工作线程正在执行任务时,如果生产者对工作者有新任务,则生产者会将任务发送到工作线程,即使

I''m not clear on the operation of the producer consumer queue threading logic. Here''s my question: If the producer sends a task to the worker thread and while the worker thread is performing the task if the producer has a new task for the worker will it (producer) send the task to the worker thread even if the worker thread has not completed the first task?

推荐答案

我喜欢以下有关C#中线程化的文章: C#中的线程 [ ^ ] 我知道这里有很多信息,您可能期望直接回答您的问题,但是我很确定,在学习本文之后,您将对Threading毫无疑问:) I like the following article about threading in C#: Threading in C#[^] I know that there is a lot of information and probably you are expecting the direct answer to your question but I''m pretty sure that after learning this article you will have no question about Threading :)

,请参阅我的提示/技巧文章:针对线程通信和线程间调用 [ ^ ].
—SA
Please see my Tips/Tricks article: Simple Blocking Queue for Thread Communication and Inter-thread Invocation[^].
—SA

更多推荐

生产者使用者队列

本文发布于:2023-10-15 00:57:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1492765.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:生产者   队列   使用者

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!