lkml.org 
[lkml]   [2005]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: sched_yield() makes OpenLDAP slow
    Robert Hancock wrote:

    >
    > I fail to see how sched_yield is going to be very helpful in this
    > situation. Since that call can sleep from a range of time ranging from
    > zero to a long time, it's going to give unpredictable results.
    >

    Well, not sleep technically, but yield the CPU for some undefined
    amount of time.

    > It seems to me that this sort of thing is why we have POSIX pthread
    > synchronization primitives.. sched_yield is basically there for a
    > process to indicate that "what I'm doing doesn't matter much, let other
    > stuff run". Any other use of it generally constitutes some kind of hack.
    >

    In SCHED_OTHER mode, you're right, sched_yield is basically meaningless.

    In a realtime system, there is a very well defined and probably useful
    behaviour.

    Eg. If 2 SCHED_FIFO processes are running at the same priority, One can
    call sched_yield to deterministically give the CPU to the other guy.

    --
    SUSE Labs, Novell Inc.

    Send instant messages to your online friends http://au.messenger.yahoo.com

    -
    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: 2005-08-20 06:22    [W:4.646 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site