Thread models Semantics: Solaris and Linux M:N to 1:1 thread model Ahmad Mohsin 1 , Syed Irfan Raza 2 , Syda Fatima 3 1, 2, 3 Department of Computer Science and Engineering, Air University Multan Pakistan {ahmadspm, irfanrazanaqvi9, silenteyes36 }@gmail.com Abstract. Multithreading has got significance with increasing demand for performance, speed and efficiency. As the hardware resources are becoming more powerful in terms of performance there is immense pressure on system software development side to optimize the hardware. Effective use of multithreading needs some mechanism to implement. Thread models have greater impact on application execution time, and I/O operations. Work has been done on Multithread models like M:1, 1:1 and M:N. Earlier M: N was considered best among all because of its performance benchmarks. Currently the Linux and So- laris have shifted from M: N to 1:1 thread model despite of the advantages of M:N. Our emphasis will be on 1:1 Model seman- tics for shifting. This paper gives a thorough review of operating system thread models. We have researched factors which compelled different OS platforms to shift to 1: 1 Model. Pros and cons of hybrid model and 1:1 are provided, later perform- ance evaluation is provided. At the end of the paper some semantics are presented for preferred thread model o justify our support for 1:1 Model. Keywords: multithreading, hybrid threading, 1:1 Thread Models kernel threading, multithreading models. 1 Introduction Multithreading is important feature for any operating system and its importance has been increased since the emergence of multicore processors and optimized system memory architectures. A thread of execution is the smallest series of pro- grammed instructions that can be managed independently. There are multiple threads which may exist within the same pro- cess that share memory and other resources of the process [8]. Three models are commonly used for mapping. The rst methodology, M: 1 implements all threads in user space where all application software execute and appear to the kernel as single-threaded process. One of the greater drawbacks however is that it cannot get advantage from multi- processor computers also no more than one thread is scheduled at the same time [3]. In contrast to M:N , 1:1 model which means that threads created by the user are in 1-1 mapping with threads in the kernel level. Initially Win32 API used this method. Linux platform uses C library to implement this model. The same ap- proach is used by Solaris, NetBSD and FreeBSD. But this approach is dependent on underlying kernel [3] [8]. M:N is a hy- brid model and simply a compromise between kernel-level ("1:1") and user-level ("N:1") threading. This methodology also provides signicant performance when threads in an application are synchronizing with each other. As M:N provides many advantage over other two models but still it is not a feasible solution [12]. Finally, the costs for maintaining the additional code necessary for an M-on-N implementation cannot be deserted [4]. Section II will cover multithreading background, and architectures, Section III discuss all three multithreading models, Section IV will see some pros and cons of M:N and 1:1 thread models. In Section V we will focus semantics. Finally Sec- tion VI will cover performance evaluation; Section VII mentions covers Conclusion. 2 Multithreading Background and Architecture Multithreading refers to the ability of an Operating System to support multiple and concurrent paths of execution within a process [13]. To discriminate processes from threads, the unit of scheduling and dispatching is called a thread or LWP (light- weight process) LWP is seen as virtual processor by thread library, while the unit having assigned all resources referred to as a process (or task). In a multithreaded environment, a process is defined as the unit of resource allocation and a unit of protection [9] [10]. In multithreaded environment, there is still a single PCB (process control block) and user address space for each process but there are separate stacks for each thread and also a separate control block for each thread containing register values, priority, First International Conference on Modern Communication & Computing Technologies (MCCT'14) (Short Paper / WiP) 26-28 February, 2014, NawabShah, Pakistan