All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Fremlin <chief@bandits.org>
To: <root@chaos.analogic.com>
Cc: Oliver Neukum <Oliver.Neukum@lrz.uni-muenchen.de>,
	<linux-kernel@vger.kernel.org>
Subject: Re: how to let all others run
Date: 05 Apr 2001 16:55:50 +0100	[thread overview]
Message-ID: <m2itkjwdbt.fsf@boreas.yi.org.> (raw)
In-Reply-To: <Pine.LNX.3.95.1010404165539.4737A-100000@chaos.analogic.com>
In-Reply-To: "Richard B. Johnson"'s message of "Wed, 4 Apr 2001 17:00:32 -0400 (EDT)"

"Richard B. Johnson" <root@chaos.analogic.com> writes:

> On 4 Apr 2001, John Fremlin wrote:
> > 
> > Hi Oliver!
> > 
> >  Oliver Neukum <Oliver.Neukum@lrz.uni-muenchen.de> writes:
> > 
> > > is there a way to let all other runable tasks run until they block
> > > or return to user space, before the task wishing to do so is run
> > > again ?
> > 
> > Are you trying to do this in kernel or something? From userspace you
> > can use nice(2) then sched_yield(2), though I don't know if the linux
> > implementations will guarrantee anything.
> > 
> 
> I recommend using usleep(0) instead of sched_yield(). Last time I
> checked, sched_yield() seemed to spin and eat CPU cycles, usleep(0)
> always gives up the CPU.

What is wrong with this? sched_yield only yields to processes with
lower priority (hence suggestion to use nice(2)). Does sched_yield()
fail to yield in cases when a higher priority process wants to run? 
usleep() wastes time if no other such process is waiting, surely?

[...]

-- 

	http://www.penguinpowered.com/~vii

  reply	other threads:[~2001-04-05 15:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-02 14:05 how to let all others run Oliver Neukum
2001-04-04 20:11 ` John Fremlin
2001-04-04 21:00   ` Richard B. Johnson
2001-04-05 15:55     ` John Fremlin [this message]
2001-04-05 16:52       ` Richard B. Johnson
2001-04-05 20:41         ` Oliver.Neukum
2001-04-05 21:08           ` Richard B. Johnson
2001-04-05 22:29         ` Ion Badulescu

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=m2itkjwdbt.fsf@boreas.yi.org. \
    --to=chief@bandits.org \
    --cc=Oliver.Neukum@lrz.uni-muenchen.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.