From: "David Schwartz" <davids@webmaster.com>
To: "Iker" <iker@computer.org>, <linux-kernel@vger.kernel.org>
Subject: RE: [lkml] RE: self piping and context switching
Date: Fri, 12 Sep 2003 20:31:48 -0700 [thread overview]
Message-ID: <MDEHLPKNGKAHNMBLJOLKMECLGIAA.davids@webmaster.com> (raw)
In-Reply-To: <03f501c379a2$b14b49b0$3203a8c0@duke>
> More specifically, I was wondering if the write to the pipe or
> the call back
> into poll involved anything that might prompt the scheduler to replace the
> thread in this scenario.
Sure, it could, but there's no particular reason to expect it to. The one
exception would be if another thread was already blocked waiting for that
particular pipe. In this case, your sending data on the pipe would unblock
that thread, which could trigger a pre-emption.
> > It's reasonable to expect that this will be the most common case and the
> > one to optimize. It is unreasonable to fail if this doesn't
> > happen, since
> > it's not guaranteed to happen. Note that if by "without a
> > context switch"
> > you really mean without another thread getting a chance to run,
> > then it is
> > totally unreasonable.
> Are you referring to transitions to/from kernel space? If so, wouldn't the
> write
> on the pipe and the call to poll both result in transitions?
Yes, but there's no reason that transition should cause the kernel to want
to change processes. The kernel generally tries to let processes complete
their timeslice. An exception could certainly be if the write to the pipe
causes a new thread to unblock and that that thread has a higher dynamic
priority (which it well might, since it was waiting).
Personally, I don't think the kernel should ever pre-empt threads/processes
with equivalent static priorities, but that's another whole argument. ;)
DS
next prev parent reply other threads:[~2003-09-13 3:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-13 1:19 Iker
2003-09-13 2:04 ` David Schwartz
2003-09-13 2:56 ` [lkml] " Iker
2003-09-13 3:31 ` David Schwartz [this message]
2003-09-13 17:10 ` Alan Cox
2003-09-13 19:37 ` Jamie Lokier
2003-09-15 23:36 ` Robert White
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=MDEHLPKNGKAHNMBLJOLKMECLGIAA.davids@webmaster.com \
--to=davids@webmaster.com \
--cc=iker@computer.org \
--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®