• Konstantin Osipov's avatar
    Backport of: · 7edfae4e
    Konstantin Osipov authored
    -------------------------------------------------------------
    revno: 2877
    committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
    branch nick: 35164-6.0
    timestamp: Wed 2008-10-15 19:53:18 -0300
    message:
    Bug#35164: Large number of invalid pthread_attr_setschedparam calls
    Bug#37536: Thread scheduling causes performance degradation at low thread count
    Bug#12702: Long queries take 100% of CPU and freeze other applications under Windows
    
    The problem is that although having threads with different priorities
    yields marginal improvements [1] in some platforms [2], relying on some
    statically defined priorities (QUERY_PRIOR and WAIT_PRIOR) to play well
    (or to work at all) with different scheduling practices and disciplines
    is, at best, a shot in the dark as the meaning of priority values may
    change depending on the scheduling policy set for the process.
    
    Another problem is that increasing priorities can hurt other concurrent
    (running on the same hardware) applications (such as AMP) by causing
    starvation problems as MySQL threads will successively preempt lower
    priority processes. This can be evidenced by Bug#12702.
    
    The solution is to not change the threads priorities and rely on the
    system scheduler to perform its job. This also enables a system admin
    to increase or decrease the scheduling priority of the MySQL process,
    if intended.
    
    Furthermore, the internal wrappers and code for changing the priority
    of threads is being removed as they are now unused and ancient.
    
    1. Due to unintentional side effects. On Solaris this could artificially
    help benchmarks as calling the priority changing syscall millions of
    times is more beneficial than the actual setting of the priority.
    
    2. Where it actually works. It has never worked on Linux as the default
    scheduling policy SCHED_OTHER only accepts the static priority 0.
    7edfae4e
configure.in 91.8 KB