public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
From: borasahin@justnic.com
To: kernelnewbies@nl.linux.org
Cc: Rajat Jain <rajat.noida.india@gmail.com>,
	Linux Newbie <linux-newbie@vger.kernel.org>
Subject: Re: Sleeping in Work_queue threads
Date: Mon, 25 Sep 2006 12:44:47 +0300	[thread overview]
Message-ID: <200609251244.47943.borasahin@justnic.com> (raw)
In-Reply-To: <b115cb5f0609250135h42751bc8u18242c25e86a2fd8@mail.gmail.com>


> I understand that there is a default worker thread ("event") to which
> most of the drivers submit work (for bottom half processing).
>
> Now since this thread is catering to all of the drivers; if a driver's
> code sleeps, then aren't the rest of the drivers penalised?

Yes...

> I mean the rest of the drivers want to do their work but the thread is
> now sleeping since one of the driver has issued a sleeping call?
>
> Wouldn't a seperate worker thread for each driver be a better design?

I think the worker thread is there to make driver writer's job easier. Say you 
need a bottom half but it is not sleep for a long time. Using a centralised 
worker thread is the most convenient one. But as you say if you need to sleep 
longer then you start to disrupt other driver's worker jobs. It's time to 
create a seperate worker thread. 

Another point of view -> you categorize worker threads: shorter sleep times 
and longer sleep times. You dont need to create a worker thread for each of 
the work jobs. Instead you use one for shorter sleep times and one for each 
of longer sleep times. So you use system resources more efficiently. I think 
most of worker thread jobs is fit into shorter sleep times category.

--
Bora SAHIN
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

  reply	other threads:[~2006-09-25  9:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-25  8:35 Sleeping in Work_queue threads Rajat Jain
2006-09-25  9:44 ` borasahin [this message]
2006-09-25 22:39   ` Jim Cromie
2006-09-26  9:17     ` borasahin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200609251244.47943.borasahin@justnic.com \
    --to=borasahin@justnic.com \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-newbie@vger.kernel.org \
    --cc=rajat.noida.india@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox