Re: Slow pthread_create() under high load

From: sasha@mysql.com
Date: Sat Mar 25 2000 - 06:12:03 EST

  • Next message: Delman Lee: "Re: v2.3.99p3: SHM probs"

    <cut>

    >
    > The LinuxThreads pthread_create works by passing a message through a pipe to a
    > manager thread, and then blocking. The manager thread allocates the resources
    > for the new thread and then creates it via clone(). It then unblocks the
    > original thread which is suspended inside pthread_create().

    At what point in this process will pthread_create() return? It actually returns
    very fast - the slow part is getting to the first line of the function that is
    being passed to pthread_create() in the newly created thread.

    My guess is that clone() should return very fast to the original thread, but
    might take a while to return to the newly created thread, which is what is
    causing the problem.

    <cut>

    -- 
    Sasha Pachev
    

    +------------------------------------------------------------------+ | TcX ____ __ _____ _____ ___ == mysql@tcx.se | | /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sasha Pachev | | /*/ /*/ /*/ \*\_ |*| |*||*| mailto:sasha@mysql.com | | /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Provo, Utah, USA | | /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ | | ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ | | /*/ \*\ Developers Team | +------------------------------------------------------------------+

    - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Sat Mar 25 2000 - 13:24:28 EST