How to create your own Thread Library or Package ?
Hello friends.. 🙂 This special post is for those who want to create thread library/package of their own and don’t know from where to start. So lets begin, and see from where you should start. Threads often provided in the form of thread package . Such package contains operations to create and destroy threads as well as operations on synchronization variables such as mutex and condition variables . There are basically two approaches to implement thread package/library. To create a thread library that is executed entirely in user mode. To create a thread library that is executed in user mode as well as in kernel mode/ using LWP (Let the kernel aware of threads and schedule them) Advantages of building user-level thread library : First, it is cheap to create and destroy threads. Because all thread administration is kept in the user’s address space, the price of creating a thread is primarily determined by the cost for allocating memory to set up a thread stack. Analogousl