本文介绍了生产者使用者队列-线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
—SA
Please see my Tips/Tricks article: Simple Blocking Queue for Thread Communication and Inter-thread Invocation[^].
—SA
我不清楚生产者使用者队列线程逻辑的操作.这是我的问题:如果生产者将任务发送到工作线程,而在工作线程正在执行任务时,如果生产者对工作者有新任务,则生产者会将任务发送到工作线程,即使
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 :)
,请参阅我的提示/技巧文章:针对线程通信和线程间调用 [ ^ ].
更多推荐
生产者使用者队列
发布评论