Ashutosh Anand
Ashutosh Anand

Reputation: 179

What does pthread_create in linux?

Am a newbie to OS , So, I want to know about the pthread_create (Standardized Interface ) in Linux ? What type of thread it creates ? User Level Thread or Kernel Level Thread ? Justify !

Upvotes: 1

Views: 441

Answers (2)

Read also a good Posix thread tutorial like this.

And reading a good book on advanced linux programming will also be relevant.

Upvotes: 0

paxdiablo
paxdiablo

Reputation: 881423

PThreads in Linux gives you kernel-level threads, not user-level.

This is obvious if you look at the man page for pthreads: (look for the word Both):

Both threading implementations employ the Linux clone(2) system call.

In this context, the word "Both" refers to the now unsupported LinuxThreads implementation, and the newer NPTL (Native POSIX Threads Library) in glibc.

See also this answer to get an understanding on how kernel thread scheduling works under Linux.

Upvotes: 2

Related Questions