[POSIX] implementation of pthread_create()

Loïc Grenié loic.grenie at gmail.com
Sun Mar 1 20:46:02 UTC 2009


2009/3/1 overflow_ <overflow_ at libero.it>:
> Hello to everybody.
>
> I would like to know
>
> 1) How is implemented the method pthread_create() in Linux? I mean, does it
> use a call to the clone() function or to fork()?

    With the "standard" implementation (the one you get if you do not
  do anything), it uses clone().

> 2) where is the implementation of pthread_create()? I know it's declared in
> thread.h, but where its implementation is located?

    It is pthread.h

    You can get the sources by typing

apt-get source libc6

  (this is a big collection of libraries, but it contains /lib/libpthread-2.7.so
  that implements pthread_* functions).

      Hope this helps,

            Loïc




More information about the ubuntu-users mailing list