Does every thread has its program counter
Yes
What are user level threads
They are created on user space by some library calls typically. Kernel do not know about these threads. A system call block the whole process
Are solaris 2, mach C-threads, POSIX Pthreads are user level threads
Yes
What are kernel level threads
Thread management done by kernel. Kernel aware of threads. A system call does not block the whole process.
Does Windows NT/2000, Solaris 2 and linux are kernel level thread examples
Yes
How many models are for thread implementation
Many-to-one model: A user level may have multiple thread but for kernel end, there will be only one thread to support it.
One-to-one model: One user thread per kernel thread
Many-to-many model: Multiple user threads multiplexed over a smaller or equal number of kernel threads
In which thread model we have true concurrency
one-to-one model
What is LWP
Light-weight process
What is PThread
A POSIX standard API for thread creation, termination and synchronization.
What are type of errors in threads
What is EAGAIN error
System imposed limit to total number of threads in a process.
What are 3 reasons for a thread to terminate
How to include PThread library in code
- use gcc command with -lpthread option