Your Question: Which System Call Is Used to Create a Thread in Linux?
Contents the Underlying System Call to Create Threads Is Clone(2) (It Is Linux Specific). How a Thread Is Created by System Calls? Threads Are Created Using...
The underlying system call to create threads is clone(2) (it is Linux specific).
How a thread is created by system calls?
Threads are created using the clone() system call that can make a new process that shares memory space and some of the kernel control structures with its parent. These processes are called LWPs (light-weight processes) and are also known as kernel-level threads.
Must Read
How threads are created in Linux?
It uses the pthread_create() function to create two threads. The starting function for both the threads is kept same. Inside the function ‘doSomeThing()’, the thread uses pthread_self() and pthread_equal() functions to identify whether the executing thread is the first one or the second one as created.