lkml.org 
[lkml]   [2012]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Work queue questions
Hello,

On Fri, Sep 21, 2012 at 07:30:21PM +0100, Deepawali Verma wrote:
> Actually I want to make parallelization of one task into three tasks.
> Therefore I created three single threaded work queues means divide the
> task into three tasks. You are right that I can use one work queue as
> well. But when I am doing three times schedule on different work
> queues, I am seeing only one worker thread is processing the three
> times schedule though I created three different workqueues and I
> believe from previous kernel versions that there is one worker thread
> associated with one queue. If one thread does this task then there is
> no difference between doing the same task in one thread and using
> three threads.
>
> If we create different work queues, why always one worker thread is
> processing the all tasks instead I want another two threads also work
> in parallel?

Well, that was the whole point of concurrency managed workqueue. You
don't need to worry about the number of workers. Concurrency is
automatically managed. If you queue three work items on, say,
system_wq and none of them sleeps, a single worker will execute them
back to back. If a work item sleeps, another worker will kick in.
So, in most cases, there's no need to worry about concurrency - just
use system_wq.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2012-09-22 03:41    [W:0.128 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site