From: Clemens Ladisch <clemens@ladisch.de>
To: "Eibach, Dirk" <Eibach@gdsys.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: msleep() an load average
Date: Wed, 04 May 2011 15:47:17 +0200 [thread overview]
Message-ID: <4DC158E5.50908@ladisch.de> (raw)
In-Reply-To: <48D3D52125C49B43AE880038E2E5314BB5BE9D@SRV101.gdsys.de>
Eibach, Dirk wrote:
> while(1) msleep_interruptible(1000);
>
> Is this code really any better?
You should handle signals, probably by blocking any that you're not
interested in, and exiting on any fatal one.
Anyway, polling is bad; this code forces the CPU to wake up once
per second. What is your thread _actually_ waiting for?
(I guess it has more code than what you wrote?)
Regards,
Clemens
next prev parent reply other threads:[~2011-05-04 13:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-04 12:11 Eibach, Dirk
2011-05-04 13:37 ` Jiri Slaby
2011-05-04 13:54 ` Eibach, Dirk
2011-05-04 14:30 ` Clemens Ladisch
2011-05-04 14:47 ` Eibach, Dirk
2011-05-04 13:47 ` Clemens Ladisch [this message]
2011-05-04 14:04 ` Eibach, Dirk
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=4DC158E5.50908@ladisch.de \
--to=clemens@ladisch.de \
--cc=Eibach@gdsys.de \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®