lkml.org 
[lkml]   [2007]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Network slowdown due to CFS
    On Mon, 1 Oct 2007 09:49:35 -0700
    "David Schwartz" <davids@webmaster.com> wrote:

    >
    > > * Jarek Poplawski <jarkao2@o2.pl> wrote:
    > >
    > > > BTW, it looks like risky to criticise sched_yield too much: some
    > > > people can misinterpret such discussions and stop using this at
    > > > all, even where it's right.
    >
    > > Really, i have never seen a _single_ mainstream app where the use of
    > > sched_yield() was the right choice.
    >
    > It can occasionally be an optimization. You may have a case where you
    > can do something very efficiently if a lock is not held, but you
    > cannot afford to wait for the lock to be released. So you check the
    > lock, if it's held, you yield and then check again. If that fails,
    > you do it the less optimal way (for example, dispatching it to a
    > thread that *can* afford to wait).


    at this point it's "use a futex" instead; once you're doing system
    calls you might as well use the right one for what you're trying to
    achieve.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" 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.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-10-01 21:59    [W:0.023 / U:0.048 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site