This is the mail archive of the
glibc-linux@ricardo.ecn.wfu.edu
mailing list for the glibc project.
Re: Slow pthread_create() under high load
- To: Kaz Kylheku <kaz at ashi dot footprints dot net>
- Subject: Re: Slow pthread_create() under high load
- From: sasha at mysql dot com
- Date: Sat, 25 Mar 2000 04:12:03 -0700
- CC: glibc-linux at ricardo dot ecn dot wfu dot edu, linux-kernel at vger dot rutgers dot edu, mysql at lists dot mysql dot com, monty at mysql dot com
- Organization: MySQL
- References: <Pine.LNX.4.10.10003242056100.14602-100000@ashi.FootPrints.net>
- Reply-To: glibc-linux at ricardo dot ecn dot wfu dot edu
<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 |
+------------------------------------------------------------------+