Java Virtual Machine

Size: px
Start display at page:

Download "Java Virtual Machine"

Transcription

1 Evaluation of Java Thread Performance on Two Dierent Multithreaded Kernels Yan Gu B. S. Lee Wentong Cai School of Applied Science Nanyang Technological University Singapore Abstract Modern programming languages and operating systems encourage the use of threads to exploit concurrency and simplify program structure. An integral and important part of the Java language is its multithreading capability. Despite the portability of Java threads across almost all platforms, the performance of Java threads varies according to the multithreading support of the underlying operating system and the way Java Virtual Machine maps Java threads to the native system threads. In this paper, a well-known compute-intensive benchmark, the EP benchmark, was used to examine various performance issues involved in the execution of threads on two dierent multithreaded platforms: Windows NT and Solaris. Experiments were carried out to investigate thread creation and computation behavior under dierent system loads, and to explore execution features under certain extreme situations such as the concurrent execution of very large number of Java threads. Some of the experimental results obtained from threads were compared with a similar implementation using processes. These results show that the performance of Java threads diers depending on the various mechanisms used to map Java threads to native system threads, as well as on the scheduling policies for these native threads. Thus, this paper provides important insights into the behavior and performance of Java threads on these two platforms, and highlights the pitfalls that may be encountered when developing multithreaded Java programs. 1 Introduction A thread [1] is a single unit of execution within a process. In a multithreaded program there are multiple threads running concurrently within a single address space while each has its own sequence of instructions. Modern programming languages (e.g., Java), and operating systems (e.g., Windows NT and Solaris), encourage the use of threads to mask communication latency and overhead of some operations. Recently, the scientic computing community has started using threads to mask network communication latency in massively parallel architectures, allowing computation and communication to be overlapped. In general, it would be desirable if threaded programs could be written to expose the largest degree of parallelism possible, or 1

2 to simplify the program design. With multiprocessing systems available on several popular processor architectures, multithreading has become an important programming paradigm. Over the past few years, Java has emerged as an important programming language in the computing community. It has a number of features that are widely received: object orientation, portability and multithreading support. The portability of the language oers a means of reducing the cost of maintaining software support across dierent platforms. Portability does not mean that the application will behave in a similar manner when running across dierent platforms. This is especially true in the case of a multithreaded Java application. The main reason for the diversity of Java thread execution models is that Java threads are mapped to the native system threads in dierent manners and the native system supports threads at dierent levels. Thus, Java threads represent a platform specic abstraction on top of native threads and the variations of their performance on dierent multithreading kernels reect the internal thread support in those operating systems accordingly. This paper is organized as follows: Section 2 describes two main mapping models of Java threads on two multithreaded kernel operating systems. Experimental results comparing the performance of Java threads on those two platforms are presented in Section 3, and evaluated in Section 4. Section 5 concludes the paper with the discussion on the major ndings. 2 Characteristics of Java Threads on Multithreaded Kernels The Java thread package [2] makes threads an integral part of Java language and provides a rich collection of methods to start, run, stop and query the state of Java threads. Java thread is preemptive, which means a lower priority thread can be forced o a processor in favor of a higher priority thread. Java Virtual Machine (Java VM) makes the implementation details transparent to the Java users and achieves the portability of threads among almost all platforms. Despite the uniform thread interface in Java, variations in the implementations of Java thread on dierent platforms aect its behavior and performance. Some operating systems, including older releases of UNIX and Macintoshes, do not support threads. On those systems, the Java VM has to emulate threads. With the increased popularity of symmetric multiprocessing (SMP) machines, operating systems, such as Solaris and Windows NT, oer multithreaded kernels to provide highly concurrent, responsive operations. When running on those systems, the Java VM maps Java threads to native threads. Two main multithreaded kernels on which Java VM maps Java threads are discussed as follows: One-to-one mapping on the Windows NT [3, 4] system (i.e., Section 2.1) Many-to-one/Many-to-Many mapping on the Solaris [5, 6] system (i.e., Section 2.2) 2.1 Windows NT The multithreading kernel support on Windows NT is among the rst implementations of true multithreading. Creating a Win32 process automatically creates the process's main thread. Auxiliary threads can be created in the process afterwards. Each thread has its own stack, the size of which is specied at creation time. The Windows NT operating system does preemptive 2

3 Java Process Java Java Java thread thread thread Java Applications Java Virtual Machine Kernel Win32 Win32 Win32 thread thread thread scheduling entity: Win32 thread Figure 1: One-to-One Mapping Model on Windows NT multitasking on a per-thread (not per-process) basis and threads are the scheduling entities. Unlike the Solaris two-tier thread model (Section 2.2), Windows NT uses a straightforward One-to-One mapping between a user thread and a kernel thread. In this implementation, each user-level thread created by the application is known to the kernel and all threads can access the kernel. The main problem with this model is that it places a restriction on the developer to be careful and frugal with threads, as each additional thread adds more weight to the system. As a consequence, the thread package in Windows NT limits the number of threads supported in the system. The default thread scheduling scheme for the Win32 kernel threads is round-robin with dynamic priority adjustment. With the round-robin scheduling, threads of equal priority, if that priority is the highest among other threads, are time-sliced. The operating system assigns a running thread a CPU time-slice, on the order of 20 milliseconds. If a thread with this policy becomes ready, and it has a higher priority than the currently running thread, the kernel preempts the current thread and immediately begins running the higher-priority thread. The Java Virtual Machine on Windows NT maps Java threads directly to native Win32 operating system threads with a One-to-One mapping as shown in Figure 1. Since the scheduling entities are native threads, the CPU time is time sliced among all the threads that have been created. 2.2 SUN Solaris The multithreaded programming model in Solaris has two levels. The rst level is the user thread interface with which programmers write their multithreaded programs. The second level is the lightweight process (LWP). The Solaris LWPs are the schedulable entities. Each LWP is independently dispatched and scheduled by the kernel onto the available CPU. Each process contains one or more LWPs and each of which runs one or more user threads. The thread library schedules user threads onto the pool of LWPs without the involvement of the kernel. Although the two-level thread model adds some extra responsibility to the user, it allows for the cheap creation of user threads without using a lot of system resources. The kernel schedules all LWPs in round-robin manner. In contrast, the Solaris user threads within the same process use 3

4 Java Process Java Process Java Java Java thread thread thread Java Applications Java Java Java thread thread thread Java Applications Java Virtual Machine Java Virtual Machine User Space User Space green green green thread thread thread native native native thread thread thread User Thread Library User Thread Library Kernel Multiprocessor Kernel LWP scheduling entity: LWP LWP LWP scheduling entity: LWP (a) Many-to-One Mapping (b) Many-to-Many Mapping Figure 2: Thread Mapping Model on Solaris a default FIFO (First-In-First-Out) scheduling policy. The highest priority thread is scheduled by the user thread library to run on the LWP until it is blocked. If there is more than one user thread with the same priority and that priority is the highest among all the threads, the rst running thread will continue until it is blocked. Prior to Solaris 2.6, Java threads run as pure user-level threads called green threads. All of the user threads within the same process are bound to one kernel LWP in a Many-to-One manner, as shown in Figure 2(a). With the FIFO scheduling policy in Solaris, user threads with the same priority running in the same process are not time-sliced and require the applications to schedule them explicitly. When Java threads run on Solaris 2.6 with the support of the newer version of Java Virtual Machine such as JDK1.2 beta, they are mapped onto native unbound Solaris threads as shown in Figure 2(b). In the Many-to-Many model supported in Solaris 2.6, a user-level thread library provides sophisticated scheduling of user-level threads above kernel threads. The Many-to-Many mapping can avoid many of the limitations of the Manyto-One mapping model on Solaris green threads. It allows a program to have as many threads as appropriate without making the process too heavily loaded or burdensome. However, our initial testing of the native thread support using JDK 1.2 beta on a two-processor UltraSPARC Sun SMP and a one-processor Sun SPARC 20 shows that the Many-to-Many mapping is only supported on the multi-processor platform. On the one-processor system, only one LWP is allocated to support all the threads belonging to the same process. On the dual processor system used in our experiment, threads created within the same process are divided equally among the two processors, each having one LWP to support their execution. In the best case, there is a speedup of 2 on the two-processor machine. Therefore, on a single processor system, 4

5 similar performance will be observed for both types of Java thread mappings. 3 Experiments and Results An EP benchmark [7] was implemented using Java threads and processes to assess the performance of Java threads under dierent multithreading platforms. The EP program adopts the master-slave model. The master task distributes computation work to all the slave tasks before computation, and slave tasks send results back to the master task after computation. All tasks carry out the same amount of computation. Tasks were implemented using both threads and processes for comparison. Two parameters were measured: computation time and spawn time. In addition, experiments were also conducted to test the maximum number of threads that can be created for each operating system. The set-up of the experiment environment is as follows: a PC Pentium, 200MHz with 64 Mbytes of memory, running Windows NT 4.0 a SUN Sparc 20 single-processor workstation, 60 MHz with 32 Mbytes of memory, running Solaris 2.4. The Java Development Kit used is JDK1.1.5 on both PC and workstation without the just-intime compiler. 3.1 Spawn Time Spawn time refers to the duration from the time when the main thread calling the spawn function till the time when the spawned task starts executing. Figure 3 shows the average spawn time per task on both Windows NT and SUN Solaris. Logarithmic scale on the Y axis (i.e., the spawn time) is used to highlight the relatively small spawn time of Java threads compared with that of Java processes. As seen from the gure, the spawn time of threads is less than that of the processes by an order of tens to hundreds. The reason for this sharp variation is that all the threads share the process address space and each of them only needs a stack, a program counter and registers to start their execution. On the other hand, in the case of process, a new Java Virtual Machine needs to be loaded for the creation of a Java process. In addition a new address space and other system resources also need to be allocated. 3.2 Computation Time A number of experiments were conducted to compare the computational performance of threads and processes using EP benchmark. Comparison is made under two typical run-time environments: one with light background load and the other with heavy background load. On the single processor PC and workstation used in this experiment, the operating system time-slices scheduling units (either LWPs on Solaris or Win32 kernel threads on Windows NT) and schedules them to run on the CPU alternatively. Intuitively, the EP execution time will remain unchanged no matter how many tasks are used, since the EP problem size is xed in 5

6 Thread Process Spawn Time(ms) Number of Tasks (a) Average Spawn Time on Windows NT Thread Process Spawn Time(ms) Number of Tasks (b) Average Spawn Time on Solaris Figure 3: Average Spawn Time 6

7 our experiment. However, this is not the case observed in the experiments, as seen from the following test results. As a matter of fact, the thread management overhead together with the load exerted by other scheduling entities running on the same machine aects the performance of EP execution. With more tasks (either processes or threads) executing at the same time, the operating system overhead to manage them will increase accordingly. If there are other user applications executing on the same machine with the same priority, the EP tasks have to share CPU time with those user applications Performance under Light Load Thread Process Computation Time(sec.) Number of Tasks (a) EP Computation Time under Light Load on Windows NT Thread Process Computation Time(sec.) Number of Tasks (b) EP Computation Time under Light Load on Solaris Figure 4: EP Computation Time under Light Load Figure 4 presents the computation time for EP benchmark under light system load. In this experiment light load refers to the situation when there are no other active user applications 7

8 in the system. Figure 4(a) is the result obtained on Windows NT. The major point worth noting is that it does not make too much dierence on the performance whether Java threads or processes are used as EP computing units. This agrees with what can be deduced from the One-to-One thread-mapping model. However, at the threshold of 14 tasks, the computation time of threads starts to increase dramatically. This sudden increase of computation time is due to the applicability of threads that is limited by the space and time overhead. The time overhead is incurred in the form of saving and restoring a set of registers to and from memory at every context switch. Thread applications incur space overhead because the system allocates memory for thread stack segments. The stack segment is allocated by the Java Virtual Machine automatically and it must accommodate the maximum activation record requirements of each thread. For those applications using large number of threads or with tight memory constraints, thread creation will exhaust memory assigned to a process. As a result, the execution of the application will be slowed down due to TLB (Translation look-aside Buer) misses and excessive paging. In Windows NT, each process has a set of resource quota limits that restrict how much memory the threads of a process can use for opening handles to objects. The quota limits regulate how much memory, paging le space, and execution time the threads of the process collectively use. In this experiment, the sudden increase of execution time for threads is mainly caused by the space overhead. All the EP threads share the limited system memory of a process, whereas each EP process has its own memory allocated by the system. Figure 4(b) compares the EP computation time for threads and processes on Solaris. The value on the Y axis (i.e., the computation time) is in the range of 77? 82 seconds in order to highlight the slight dierence of the execution time between threads and processes. It can be observed from this gure that there is an increasing tendency in the computation time for both threads and processes as more tasks are involved in the EP computation. This is due to the increasing overhead required to manage more threads or processes. The other point that can be noticed is that processes always need a little more execution time than threads and the time dierence between them is enlarged gradually as the number of tasks (either threads or processes) increases. The explanation for this overhead is that each process is mapped to at least one LWP, while each Java thread is mapped to a user thread. The context switch of user threads, whose activity is restricted to user space, does not need the involvement of the kernel and is much faster than that of a process. In contrast, the context switch of processes needs to change the whole address space in the system kernel Performance under Heavy Load Figure 5 illustrates the results obtained from the execution of EP benchmark under heavy load. The load on the system is generated using ten Java processes, each of which does oatingpoint multiplication in an innite loop. Figure 5(a) shows that the performance of threads and processes on Windows NT is quite similar before reaching the threshold value. This is obvious because the scheduling entities in Windows NT are NT threads and the Java threads are mapped to the NT threads on a One-to-One basis. When more EP tasks (threads/processes) run in the system, a larger portion of the CPU time can be obtained by those EP tasks, thus resulting in the speed up as shown in the gure. The sudden increase at the threshold in Figure 5(a) can be explained by the same reason that was given for Figure 4(a). Figure 5(b) reveals the fact 8

9 Thread Process Computation Time(sec.) Number of Tasks (a) EP Computation Time under Heavy Load on Windows NT Thread Process Computation Time(sec.) Number of Tasks (b) EP Computation Time under Heavy Load on Solaris Figure 5: EP Computation Time under Heavy Load 9

10 that processes have a better performance than threads under heavy load in Solaris. There is no uctuation in the computation time for dierent numbers of threads since they are always mapped to one LWP and the scheduling entity for CPU is LWP. However, the computation time for processes decreases when more processes are used. The reason lies in the fact that each process is mapped to at least one LWP. When more processes are created for the EP benchmark, the system will allocate more LWPs for scheduling the processes. Hence, a larger portion of the CPU cycles will be allocated for EP computation. 3.3 Performance Using Very Large Number of Threads In order to understand the eects of thread mapping on Java threads, two more experiments were conducted to test the characteristics of Java threads under certain extreme situations. To nd out the maximum number of Java threads that can run in the system as well as to explore the Java thread performance under such kind of situations, a large number of threads are spawned in each system for computing the EP benchmark with the same problem size. Figure 6 presents the EP execution time using very large number of threads. After the number of threads used exceeds the system threshold value (i.e., 14 threads in our experiments), the execution time increases signicantly as more threads are used in the computation. The execution time using 200 threads is around 90 times of that using one thread. This result is due to the thread space and time overhead. That is, the process memory is not enough to satisfy the stack segment memory requirements for such a large number of threads. As a result, there are a lot of TLB misses and excessive paging during the execution. Further more, with a large number of threads, the context switch overhead also becomes signicant. All the NT threads are executed in timesliced manner with the round-robin scheduling policy. This results in frequent context switches among these threads. In contrast, Figure 6(b) shows that the execution time is unchanged when the number of threads used increases to 200 in Solaris system. In Solaris, the Many-to-One model maps Java threads to user level threads. All the user threads in the same process are not time-sliced, and the context switch only happens when a running thread nishes its execution and the user thread library schedules another thread to run. Hence, the context switch overhead among these Solaris user threads is almost negligible compared with the computation time. However, Figure 6(c) shows that the performance deteriorates when the number of threads used exceeds a certain threshold value (i.e., 800 threads in this experiment). The computation time using 4000 threads is around 8 times of that using one thread. This performance deterioration is mainly caused by the overhead to maintain the large number of threads in the system. With the large number of threads working on the same problem, each thread bears much less computation work. Although the context switching overhead is not the major problem in user level thread package, the overhead to initialize, start, and terminate each user thread begins to dominate the thread's execution time. The results obtained in these experiments suggest that the additional step of Java thread mapping in Solaris, that is, the mapping from Java thread to the user-level thread, allows more Java threads to be executed without aecting the performance too much. However, in spite of the fact that thread (especially user thread) is a lighter weight execution unit compared with process, the use of excessively large number of threads should be avoided whenever possible. 10

11 Thread Execution Time(sec.) Number of Threads (a) EP Execution Time on Windows NT Thread Execution Time(sec.) Number of Threads (b) EP Execution Time on Solaris Thread 350 Execution Time(sec.) Number of Threads (c) EP Execution Time on Solaris Figure 6: Execution Time with Large Number of Threads 11

12 4 Evaluation of Java Thread Mapping Model Java Virtual Machine makes the low-level system implementation details transparent to the users. As a consequence, Java threads are portable across dierent platforms. The mapping of Java threads to the underlying operating system is hidden from the users. The results from our experiment show that the portability of Java threads in terms of performance is not as good as expected. The performance of Java threads depends a great deal on its mapping to the underlying operating system execution unit (e.g., LWP or the kernel thread) as well as the support provided by the underlying operating system for thread execution. Windows NT has a One-to-One mapping of Java threads to the system kernel threads. The performance of threads is similar to that when processes are used. However, having too many threads in such a system has the disadvantage that the space and time overhead for executing threads may signicantly aect the performance. Thus, when using Java thread on Windows NT the users should bear in mind not to have too many threads running in the same process. In the case of Many-to-One mapping, as in Solaris, the performance of Java threads deteriorates quickly when the load in the system increases. This is because all the threads in a process are mapped to one LWP and LWP, instead of threads, are scheduling entities in the system. Although JDK1.1 or above on Solaris 2.6 claims to support the Many-to-Many mapping from Java threads to Solaris threads, our test shows that this only works for multiprocessor machines. On a single processor machine, although Java threads are mapped to Solaris threads, only one LWP is created to schedule all the threads in the same process. 5 Conclusion In this paper, we investigated performance issues involved in the use of threads on two multithreaded kernels, that is, Windows NT and Solaris, with the goal of gaining a better understanding of the impact of thread mapping mechanisms and scheduling policies on Java thread behaviors across dierent operating systems. A number of experiments were conducted to characterize the behavior of Java threads, and their results were compared with that of processes. Our measurements show that Java thread spawn time is much less than that of process by an order of hundreds. We also found that the computation behaviors of Java threads under light and heavy system loads are dierent on both platforms. Our analysis shows that the behavior is determined by the mapping of Java thread to the system native threads, be it at user or kernel level, as well as the scheduling of native threads by the kernels. Two other experiments were also conducted to evaluate the system support for very large number of threads. The lessons learned from these experiments suggest that the use of excessively large number of threads should be avoided whenever possible, in order not to waste valuable CPU cycles in thread management overheads. In summary, the portability of Java thread does not represent the portability of Java thread's behavior and performance across dierent platforms. Care must be taken when developing multithreaded Java applications. 12

13 References [1] Shashi. Prasad, Multithreading Programming Techniques, New York: McGraw-Hill, [2] Daniel J. Berg, Java Threads - A White Paper, Sun Microsystems Computer Corporation, March 1996, available at: [3] Jim Beveridge and Rovert Wiener, Multithreading Applications in Win32, Addison-Wesley Developers Press, 1997 [4] Helen Custer, Inside Windows NT, Microsoft Press, 1995 [5] Sun Microsystems, Inc, Java on Solaris 2.6, A White Paper, September 1997, available at: [6] Sun Microsystems, Inc, SunOS 5.0 Multithread Architecture, a white paper, SunSoft, 1991, available at: [7] Wentong Cai, Alfred Heng, and Peter Varman, Benchmarking IBM SP1 System for SPMD Programming, in the Proceedings of 1996 International Conference on Parallel and Distributed Systems (ICPADS'96), IEEE Computer society. 13

Lecture 17: Threads and Scheduling. Thursday, 05 Nov 2009

Lecture 17: Threads and Scheduling. Thursday, 05 Nov 2009 CS211: Programming and Operating Systems Lecture 17: Threads and Scheduling Thursday, 05 Nov 2009 CS211 Lecture 17: Threads and Scheduling 1/22 Today 1 Introduction to threads Advantages of threads 2 User

More information

Motivation. Threads. Multithreaded Server Architecture. Thread of execution. Chapter 4

Motivation. Threads. Multithreaded Server Architecture. Thread of execution. Chapter 4 Motivation Threads Chapter 4 Most modern applications are multithreaded Threads run within application Multiple tasks with the application can be implemented by separate Update display Fetch data Spell

More information

Threads, SMP, and Microkernels

Threads, SMP, and Microkernels Threads, SMP, and Microkernels Chapter 4 E&CE 354: Processes 0 Multithreaded Programming So what is multithreaded programming? Basically, multithreaded programming is implementing software so that two

More information

SMD149 - Operating Systems

SMD149 - Operating Systems SMD149 - Operating Systems Roland Parviainen November 3, 2005 1 / 45 Outline Overview 2 / 45 Process (tasks) are necessary for concurrency Instance of a program in execution Next invocation of the program

More information

Operating System. Chapter 4. Threads. Lynn Choi School of Electrical Engineering

Operating System. Chapter 4. Threads. Lynn Choi School of Electrical Engineering Operating System Chapter 4. Threads Lynn Choi School of Electrical Engineering Process Characteristics Resource ownership Includes a virtual address space (process image) Ownership of resources including

More information

Process- Concept &Process Scheduling OPERATING SYSTEMS

Process- Concept &Process Scheduling OPERATING SYSTEMS OPERATING SYSTEMS Prescribed Text Book Operating System Principles, Seventh Edition By Abraham Silberschatz, Peter Baer Galvin and Greg Gagne PROCESS MANAGEMENT Current day computer systems allow multiple

More information

CHAPTER 2: PROCESS MANAGEMENT

CHAPTER 2: PROCESS MANAGEMENT 1 CHAPTER 2: PROCESS MANAGEMENT Slides by: Ms. Shree Jaswal TOPICS TO BE COVERED Process description: Process, Process States, Process Control Block (PCB), Threads, Thread management. Process Scheduling:

More information

Operating Systems: Internals and Design Principles. Chapter 4 Threads Seventh Edition By William Stallings

Operating Systems: Internals and Design Principles. Chapter 4 Threads Seventh Edition By William Stallings Operating Systems: Internals and Design Principles Chapter 4 Threads Seventh Edition By William Stallings Operating Systems: Internals and Design Principles The basic idea is that the several components

More information

Operating Systems 2 nd semester 2016/2017. Chapter 4: Threads

Operating Systems 2 nd semester 2016/2017. Chapter 4: Threads Operating Systems 2 nd semester 2016/2017 Chapter 4: Threads Mohamed B. Abubaker Palestine Technical College Deir El-Balah Note: Adapted from the resources of textbox Operating System Concepts, 9 th edition

More information

OPERATING SYSTEM. Chapter 4: Threads

OPERATING SYSTEM. Chapter 4: Threads OPERATING SYSTEM Chapter 4: Threads Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues Operating System Examples Objectives To

More information

For use by students enrolled in #71251 CSE430 Fall 2012 at Arizona State University. Do not use if not enrolled.

For use by students enrolled in #71251 CSE430 Fall 2012 at Arizona State University. Do not use if not enrolled. Operating Systems: Internals and Design Principles Chapter 4 Threads Seventh Edition By William Stallings Operating Systems: Internals and Design Principles The basic idea is that the several components

More information

Chapter 5: Threads. Outline

Chapter 5: Threads. Outline Department of Electr rical Eng ineering, Chapter 5: Threads 王振傑 (Chen-Chieh Wang) ccwang@mail.ee.ncku.edu.tw ncku edu Feng-Chia Unive ersity Outline Overview Multithreading Models Threading Issues 2 Depar

More information

Chapter 4: Threads. Chapter 4: Threads

Chapter 4: Threads. Chapter 4: Threads Chapter 4: Threads Silberschatz, Galvin and Gagne 2013 Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues Operating System Examples

More information

Threads Chapter 5 1 Chapter 5

Threads Chapter 5 1 Chapter 5 Threads Chapter 5 1 Chapter 5 Process Characteristics Concept of Process has two facets. A Process is: A Unit of resource ownership: a virtual address space for the process image control of some resources

More information

Chapter 5: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads Java Threads

Chapter 5: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads Java Threads Chapter 5: Threads Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads Java Threads 5.1 Silberschatz, Galvin and Gagne 2003 More About Processes A process encapsulates

More information

LECTURE 3:CPU SCHEDULING

LECTURE 3:CPU SCHEDULING LECTURE 3:CPU SCHEDULING 1 Outline Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time CPU Scheduling Operating Systems Examples Algorithm Evaluation 2 Objectives

More information

Processes and Threads. Processes: Review

Processes and Threads. Processes: Review Processes and Threads Processes and their scheduling Threads and scheduling Multiprocessor scheduling Distributed Scheduling/migration Lecture 3, page 1 Processes: Review Multiprogramming versus multiprocessing

More information

Threads, SMP, and Microkernels. Chapter 4

Threads, SMP, and Microkernels. Chapter 4 Threads, SMP, and Microkernels Chapter 4 Processes Resource ownership - process is allocated a virtual address space to hold the process image Dispatched - process is an execution path through one or more

More information

Chapter 4 Threads, SMP, and

Chapter 4 Threads, SMP, and Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 4 Threads, SMP, and Microkernels Dave Bremer Otago Polytechnic, N.Z. 2008, Prentice Hall Roadmap Threads: Resource ownership

More information

Multiprocessor and Real- Time Scheduling. Chapter 10

Multiprocessor and Real- Time Scheduling. Chapter 10 Multiprocessor and Real- Time Scheduling Chapter 10 Classifications of Multiprocessor Loosely coupled multiprocessor each processor has its own memory and I/O channels Functionally specialized processors

More information

Process Description and Control

Process Description and Control Process Description and Control 1 Process:the concept Process = a program in execution Example processes: OS kernel OS shell Program executing after compilation www-browser Process management by OS : Allocate

More information

Multiprocessors and Thread-Level Parallelism. Department of Electrical & Electronics Engineering, Amrita School of Engineering

Multiprocessors and Thread-Level Parallelism. Department of Electrical & Electronics Engineering, Amrita School of Engineering Multiprocessors and Thread-Level Parallelism Multithreading Increasing performance by ILP has the great advantage that it is reasonable transparent to the programmer, ILP can be quite limited or hard to

More information

Chapter 4: Multithreaded Programming. Operating System Concepts 8 th Edition,

Chapter 4: Multithreaded Programming. Operating System Concepts 8 th Edition, Chapter 4: Multithreaded Programming, Silberschatz, Galvin and Gagne 2009 Chapter 4: Multithreaded Programming Overview Multithreading Models Thread Libraries Threading Issues 4.2 Silberschatz, Galvin

More information

by Maria Lima Term Paper for Professor Barrymore Warren Mercy College Division of Mathematics and Computer Information Science

by Maria Lima Term Paper for Professor Barrymore Warren Mercy College Division of Mathematics and Computer Information Science by Maria Lima Term Paper for Professor Barrymore Warren Mercy College Division of Mathematics and Computer Information Science Table of Contents 1. Introduction...1 2. CPU Scheduling Overview...1 3. Processes

More information

Lecture 2 Process Management

Lecture 2 Process Management Lecture 2 Process Management Process Concept An operating system executes a variety of programs: Batch system jobs Time-shared systems user programs or tasks The terms job and process may be interchangeable

More information

ayaz ali Micro & Macro Scheduling Techniques Ayaz Ali Department of Computer Science University of Houston Houston, TX

ayaz ali Micro & Macro Scheduling Techniques Ayaz Ali Department of Computer Science University of Houston Houston, TX ayaz ali Micro & Macro Scheduling Techniques Ayaz Ali Department of Computer Science University of Houston Houston, TX 77004 ayaz@cs.uh.edu 1. INTRODUCTION Scheduling techniques has historically been one

More information

Interaction of JVM with x86, Sparc and MIPS

Interaction of JVM with x86, Sparc and MIPS Interaction of JVM with x86, Sparc and MIPS Sasikanth Avancha, Dipanjan Chakraborty, Dhiral Gada, Tapan Kamdar {savanc1, dchakr1, dgada1, kamdar}@cs.umbc.edu Department of Computer Science and Electrical

More information

Chapter 4: Multi-Threaded Programming

Chapter 4: Multi-Threaded Programming Chapter 4: Multi-Threaded Programming Chapter 4: Threads 4.1 Overview 4.2 Multicore Programming 4.3 Multithreading Models 4.4 Thread Libraries Pthreads Win32 Threads Java Threads 4.5 Implicit Threading

More information

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date:

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date: Subject Name: OPERATING SYSTEMS Subject Code: 10EC65 Prepared By: Kala H S and Remya R Department: ECE Date: Unit 7 SCHEDULING TOPICS TO BE COVERED Preliminaries Non-preemptive scheduling policies Preemptive

More information

Chapter 4: Threads. Operating System Concepts 9 th Edition

Chapter 4: Threads. Operating System Concepts 9 th Edition Chapter 4: Threads Silberschatz, Galvin and Gagne 2013 Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues Operating System Examples

More information

Threads. Raju Pandey Department of Computer Sciences University of California, Davis Spring 2011

Threads. Raju Pandey Department of Computer Sciences University of California, Davis Spring 2011 Threads Raju Pandey Department of Computer Sciences University of California, Davis Spring 2011 Threads Effectiveness of parallel computing depends on the performance of the primitives used to express

More information

1 Multiprocessors. 1.1 Kinds of Processes. COMP 242 Class Notes Section 9: Multiprocessor Operating Systems

1 Multiprocessors. 1.1 Kinds of Processes. COMP 242 Class Notes Section 9: Multiprocessor Operating Systems COMP 242 Class Notes Section 9: Multiprocessor Operating Systems 1 Multiprocessors As we saw earlier, a multiprocessor consists of several processors sharing a common memory. The memory is typically divided

More information

Yi Shi Fall 2017 Xi an Jiaotong University

Yi Shi Fall 2017 Xi an Jiaotong University Threads Yi Shi Fall 2017 Xi an Jiaotong University Goals for Today Case for Threads Thread details Case for Parallelism main() read_data() for(all data) compute(); write_data(); endfor main() read_data()

More information

Chapter 3 Process Description and Control

Chapter 3 Process Description and Control Operating Systems: Internals and Design Principles Chapter 3 Process Description and Control Seventh Edition By William Stallings Process Control Block Structure of Process Images in Virtual Memory How

More information

Chapter 4: Threads. Operating System Concepts 9 th Edition

Chapter 4: Threads. Operating System Concepts 9 th Edition Chapter 4: Threads Silberschatz, Galvin and Gagne 2013 Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues Operating System Examples

More information

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Processes and threads

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Processes and threads ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective Part I: Operating system overview: Processes and threads 1 Overview Process concept Process scheduling Thread

More information

Operating System Performance and Large Servers 1

Operating System Performance and Large Servers 1 Operating System Performance and Large Servers 1 Hyuck Yoo and Keng-Tai Ko Sun Microsystems, Inc. Mountain View, CA 94043 Abstract Servers are an essential part of today's computing environments. High

More information

Egemen Tanin, Tahsin M. Kurc, Cevdet Aykanat, Bulent Ozguc. Abstract. Direct Volume Rendering (DVR) is a powerful technique for

Egemen Tanin, Tahsin M. Kurc, Cevdet Aykanat, Bulent Ozguc. Abstract. Direct Volume Rendering (DVR) is a powerful technique for Comparison of Two Image-Space Subdivision Algorithms for Direct Volume Rendering on Distributed-Memory Multicomputers Egemen Tanin, Tahsin M. Kurc, Cevdet Aykanat, Bulent Ozguc Dept. of Computer Eng. and

More information

CSCI-GA Operating Systems Lecture 3: Processes and Threads -Part 2 Scheduling Hubertus Franke

CSCI-GA Operating Systems Lecture 3: Processes and Threads -Part 2 Scheduling Hubertus Franke CSCI-GA.2250-001 Operating Systems Lecture 3: Processes and Threads -Part 2 Scheduling Hubertus Franke frankeh@cs.nyu.edu Processes Vs Threads The unit of dispatching is referred to as a thread or lightweight

More information

Chapter 4: Threads. Chapter 4: Threads. Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues

Chapter 4: Threads. Chapter 4: Threads. Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues Chapter 4: Threads Silberschatz, Galvin and Gagne 2013 Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues 4.2 Silberschatz, Galvin

More information

Frank Miller, George Apostolopoulos, and Satish Tripathi. University of Maryland. College Park, MD ffwmiller, georgeap,

Frank Miller, George Apostolopoulos, and Satish Tripathi. University of Maryland. College Park, MD ffwmiller, georgeap, Simple Input/Output Streaming in the Operating System Frank Miller, George Apostolopoulos, and Satish Tripathi Mobile Computing and Multimedia Laboratory Department of Computer Science University of Maryland

More information

Multiprocessor Systems. COMP s1

Multiprocessor Systems. COMP s1 Multiprocessor Systems 1 Multiprocessor System We will look at shared-memory multiprocessors More than one processor sharing the same memory A single CPU can only go so fast Use more than one CPU to improve

More information

International Journal of Advanced Research in Computer Science and Software Engineering

International Journal of Advanced Research in Computer Science and Software Engineering Volume 3, Issue 4, April 2013 ISSN: 2277 128X International Journal of Advanced Research in Computer Science and Software Engineering Research Paper Available online at: www.ijarcsse.com Reducing the Number

More information

Frequently asked questions from the previous class survey

Frequently asked questions from the previous class survey CS 370: OPERATING SYSTEMS [THREADS] Shrideep Pallickara Computer Science Colorado State University L7.1 Frequently asked questions from the previous class survey When a process is waiting, does it get

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2017 Lecture 10 Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Chapter 6: CPU Scheduling Basic Concepts

More information

CHAPTER 4 AN INTEGRATED APPROACH OF PERFORMANCE PREDICTION ON NETWORKS OF WORKSTATIONS. Xiaodong Zhang and Yongsheng Song

CHAPTER 4 AN INTEGRATED APPROACH OF PERFORMANCE PREDICTION ON NETWORKS OF WORKSTATIONS. Xiaodong Zhang and Yongsheng Song CHAPTER 4 AN INTEGRATED APPROACH OF PERFORMANCE PREDICTION ON NETWORKS OF WORKSTATIONS Xiaodong Zhang and Yongsheng Song 1. INTRODUCTION Networks of Workstations (NOW) have become important distributed

More information

ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far.

ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far. Midterm Exam Reviews ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far. Particular attentions on the following: System call, system kernel Thread/process, thread vs process

More information

Multiprocessor scheduling

Multiprocessor scheduling Chapter 10 Multiprocessor scheduling When a computer system contains multiple processors, a few new issues arise. Multiprocessor systems can be categorized into the following: Loosely coupled or distributed.

More information

Parallel Pipeline STAP System

Parallel Pipeline STAP System I/O Implementation and Evaluation of Parallel Pipelined STAP on High Performance Computers Wei-keng Liao, Alok Choudhary, Donald Weiner, and Pramod Varshney EECS Department, Syracuse University, Syracuse,

More information

Multithreading: Exploiting Thread-Level Parallelism within a Processor

Multithreading: Exploiting Thread-Level Parallelism within a Processor Multithreading: Exploiting Thread-Level Parallelism within a Processor Instruction-Level Parallelism (ILP): What we ve seen so far Wrap-up on multiple issue machines Beyond ILP Multithreading Advanced

More information

Operating Systems: Internals and Design Principles. Chapter 2 Operating System Overview Seventh Edition By William Stallings

Operating Systems: Internals and Design Principles. Chapter 2 Operating System Overview Seventh Edition By William Stallings Operating Systems: Internals and Design Principles Chapter 2 Operating System Overview Seventh Edition By William Stallings Operating Systems: Internals and Design Principles Operating systems are those

More information

Technische Universitat Munchen. Institut fur Informatik. D Munchen.

Technische Universitat Munchen. Institut fur Informatik. D Munchen. Developing Applications for Multicomputer Systems on Workstation Clusters Georg Stellner, Arndt Bode, Stefan Lamberts and Thomas Ludwig? Technische Universitat Munchen Institut fur Informatik Lehrstuhl

More information

Multiprocessor System. Multiprocessor Systems. Bus Based UMA. Types of Multiprocessors (MPs) Cache Consistency. Bus Based UMA. Chapter 8, 8.

Multiprocessor System. Multiprocessor Systems. Bus Based UMA. Types of Multiprocessors (MPs) Cache Consistency. Bus Based UMA. Chapter 8, 8. Multiprocessor System Multiprocessor Systems Chapter 8, 8.1 We will look at shared-memory multiprocessors More than one processor sharing the same memory A single CPU can only go so fast Use more than

More information

Process Characteristics. Threads Chapter 4. Process Characteristics. Multithreading vs. Single threading

Process Characteristics. Threads Chapter 4. Process Characteristics. Multithreading vs. Single threading Process Characteristics Threads Chapter 4 Reading: 4.1,4.4, 4.5 Unit of resource ownership - process is allocated: a virtual address space to hold the process image control of some resources (files, I/O

More information

Threads Chapter 4. Reading: 4.1,4.4, 4.5

Threads Chapter 4. Reading: 4.1,4.4, 4.5 Threads Chapter 4 Reading: 4.1,4.4, 4.5 1 Process Characteristics Unit of resource ownership - process is allocated: a virtual address space to hold the process image control of some resources (files,

More information

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University Frequently asked questions from the previous class survey CS 370: SYSTEM ARCHITECTURE & SOFTWARE [CPU SCHEDULING] Shrideep Pallickara Computer Science Colorado State University OpenMP compiler directives

More information

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable What s An OS? Provides environment for executing programs Process abstraction for multitasking/concurrency scheduling Hardware abstraction layer (device drivers) File systems Communication Do we need an

More information

Multiprocessor Systems. Chapter 8, 8.1

Multiprocessor Systems. Chapter 8, 8.1 Multiprocessor Systems Chapter 8, 8.1 1 Learning Outcomes An understanding of the structure and limits of multiprocessor hardware. An appreciation of approaches to operating system support for multiprocessor

More information

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University CS 571 Operating Systems Midterm Review Angelos Stavrou, George Mason University Class Midterm: Grading 2 Grading Midterm: 25% Theory Part 60% (1h 30m) Programming Part 40% (1h) Theory Part (Closed Books):

More information

Process size is independent of the main memory present in the system.

Process size is independent of the main memory present in the system. Hardware control structure Two characteristics are key to paging and segmentation: 1. All memory references are logical addresses within a process which are dynamically converted into physical at run time.

More information

CHAPTER-1: INTRODUCTION TO OPERATING SYSTEM:

CHAPTER-1: INTRODUCTION TO OPERATING SYSTEM: CHAPTER-1: INTRODUCTION TO OPERATING SYSTEM: TOPICS TO BE COVERED 1.1 Need of Operating System 1.2 Evolution of os 1.3 operating system i. Batch ii. iii. iv. Multiprogramming Time sharing Real time v.

More information

March 6, 2000 Applications that process and/or transfer Continuous Media (audio and video) streams become

March 6, 2000 Applications that process and/or transfer Continuous Media (audio and video) streams become Increasing the Clock Interrupt Frequency for Better Support of Real-Time Applications Constantinos Dovrolis Parameswaran Ramanathan Department of Electrical and Computer Engineering University of Wisconsin-Madison

More information

Threads. CS3026 Operating Systems Lecture 06

Threads. CS3026 Operating Systems Lecture 06 Threads CS3026 Operating Systems Lecture 06 Multithreading Multithreading is the ability of an operating system to support multiple threads of execution within a single process Processes have at least

More information

operating system Spring 2017 Prof.Dr. Hasan Balik Student Name : Walid.W. Ramadan mansour Student ID :

operating system Spring 2017 Prof.Dr. Hasan Balik Student Name : Walid.W. Ramadan mansour Student ID : operating system Spring 2017 Prof.Dr. Hasan Balik Student Name : Walid.W. Ramadan mansour Student ID : 163110469 Email : wild.mansour526@gmail.com Unix SVR4 (OpenSolaris and illumos distributions) Process

More information

Chapter 8: Virtual Memory. Operating System Concepts

Chapter 8: Virtual Memory. Operating System Concepts Chapter 8: Virtual Memory Silberschatz, Galvin and Gagne 2009 Chapter 8: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

More information

Page 1. Analogy: Problems: Operating Systems Lecture 7. Operating Systems Lecture 7

Page 1. Analogy: Problems: Operating Systems Lecture 7. Operating Systems Lecture 7 Os-slide#1 /*Sequential Producer & Consumer*/ int i=0; repeat forever Gather material for item i; Produce item i; Use item i; Discard item i; I=I+1; end repeat Analogy: Manufacturing and distribution Print

More information

task object task queue

task object task queue Optimizations for Parallel Computing Using Data Access Information Martin C. Rinard Department of Computer Science University of California, Santa Barbara Santa Barbara, California 9316 martin@cs.ucsb.edu

More information

Agenda. Threads. Single and Multi-threaded Processes. What is Thread. CSCI 444/544 Operating Systems Fall 2008

Agenda. Threads. Single and Multi-threaded Processes. What is Thread. CSCI 444/544 Operating Systems Fall 2008 Agenda Threads CSCI 444/544 Operating Systems Fall 2008 Thread concept Thread vs process Thread implementation - user-level - kernel-level - hybrid Inter-process (inter-thread) communication What is Thread

More information

Chapter 4: Threads. Operating System Concepts 9 th Edit9on

Chapter 4: Threads. Operating System Concepts 9 th Edit9on Chapter 4: Threads Operating System Concepts 9 th Edit9on Silberschatz, Galvin and Gagne 2013 Chapter 4: Threads 1. Overview 2. Multicore Programming 3. Multithreading Models 4. Thread Libraries 5. Implicit

More information

Chapter 4: Threads. Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads

Chapter 4: Threads. Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads Chapter 4: Threads Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads Chapter 4: Threads Objectives To introduce the notion of a

More information

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras Week 05 Lecture 18 CPU Scheduling Hello. In this lecture, we

More information

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou (  Zhejiang University Operating Systems (Fall/Winter 2018) CPU Scheduling Yajin Zhou (http://yajin.org) Zhejiang University Acknowledgement: some pages are based on the slides from Zhi Wang(fsu). Review Motivation to use threads

More information

Windows 7 Overview. Windows 7. Objectives. The History of Windows. CS140M Fall Lake 1

Windows 7 Overview. Windows 7. Objectives. The History of Windows. CS140M Fall Lake 1 Windows 7 Overview Windows 7 Overview By Al Lake History Design Principles System Components Environmental Subsystems File system Networking Programmer Interface Lake 2 Objectives To explore the principles

More information

Memory hierarchy. 1. Module structure. 2. Basic cache memory. J. Daniel García Sánchez (coordinator) David Expósito Singh Javier García Blas

Memory hierarchy. 1. Module structure. 2. Basic cache memory. J. Daniel García Sánchez (coordinator) David Expósito Singh Javier García Blas Memory hierarchy J. Daniel García Sánchez (coordinator) David Expósito Singh Javier García Blas Computer Architecture ARCOS Group Computer Science and Engineering Department University Carlos III of Madrid

More information

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 05 Lecture - 21 Scheduling in Linux (O(n) and O(1) Scheduler)

More information

Copyright Notice David A. Solomon and Mark Russinovich

Copyright Notice David A. Solomon and Mark Russinovich Unit OS4: Scheduling and Dispatch 4.6. Quiz Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Copyright Notice 2000-2005 David A. Solomon and Mark Russinovich

More information

2017 Pearson Educa2on, Inc., Hoboken, NJ. All rights reserved.

2017 Pearson Educa2on, Inc., Hoboken, NJ. All rights reserved. Operating Systems: Internals and Design Principles Chapter 4 Threads Ninth Edition By William Stallings Processes and Threads Resource Ownership Process includes a virtual address space to hold the process

More information

Operating Systems. Figure: Process States. 1 P a g e

Operating Systems. Figure: Process States. 1 P a g e 1. THE PROCESS CONCEPT A. The Process: A process is a program in execution. A process is more than the program code, which is sometimes known as the text section. It also includes the current activity,

More information

CS418 Operating Systems

CS418 Operating Systems CS418 Operating Systems Lecture 9 Processor Management, part 1 Textbook: Operating Systems by William Stallings 1 1. Basic Concepts Processor is also called CPU (Central Processing Unit). Process an executable

More information

Chapter 4: Multithreaded Programming

Chapter 4: Multithreaded Programming Chapter 4: Multithreaded Programming Silberschatz, Galvin and Gagne 2013 Chapter 4: Multithreaded Programming Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading

More information

Threads. Computer Systems. 5/12/2009 cse threads Perkins, DW Johnson and University of Washington 1

Threads. Computer Systems.   5/12/2009 cse threads Perkins, DW Johnson and University of Washington 1 Threads CSE 410, Spring 2009 Computer Systems http://www.cs.washington.edu/410 5/12/2009 cse410-20-threads 2006-09 Perkins, DW Johnson and University of Washington 1 Reading and References Reading» Read

More information

CS420: Operating Systems

CS420: Operating Systems Threads James Moscola Department of Physical Sciences York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Threads A thread is a basic unit of processing

More information

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 4: MULTITHREADED PROGRAMMING

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 4: MULTITHREADED PROGRAMMING I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 4: MULTITHREADED PROGRAMMING Chapter 4: Multithreaded Programming Overview Multithreading Models Thread Libraries Threading

More information

instruction fetch memory interface signal unit priority manager instruction decode stack register sets address PC2 PC3 PC4 instructions extern signals

instruction fetch memory interface signal unit priority manager instruction decode stack register sets address PC2 PC3 PC4 instructions extern signals Performance Evaluations of a Multithreaded Java Microcontroller J. Kreuzinger, M. Pfeer A. Schulz, Th. Ungerer Institute for Computer Design and Fault Tolerance University of Karlsruhe, Germany U. Brinkschulte,

More information

Uniprocessor Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Three level scheduling

Uniprocessor Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Three level scheduling Uniprocessor Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Three level scheduling 2 1 Types of Scheduling 3 Long- and Medium-Term Schedulers Long-term scheduler Determines which programs

More information

Rowena Cole and Luigi Barone. Department of Computer Science, The University of Western Australia, Western Australia, 6907

Rowena Cole and Luigi Barone. Department of Computer Science, The University of Western Australia, Western Australia, 6907 The Game of Clustering Rowena Cole and Luigi Barone Department of Computer Science, The University of Western Australia, Western Australia, 697 frowena, luigig@cs.uwa.edu.au Abstract Clustering is a technique

More information

Course Syllabus. Operating Systems

Course Syllabus. Operating Systems Course Syllabus. Introduction - History; Views; Concepts; Structure 2. Process Management - Processes; State + Resources; Threads; Unix implementation of Processes 3. Scheduling Paradigms; Unix; Modeling

More information

Exercise (could be a quiz) Solution. Concurrent Programming. Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - IV Threads

Exercise (could be a quiz) Solution. Concurrent Programming. Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - IV Threads Exercise (could be a quiz) 1 2 Solution CSE 421/521 - Operating Systems Fall 2013 Lecture - IV Threads Tevfik Koşar 3 University at Buffalo September 12 th, 2013 4 Roadmap Threads Why do we need them?

More information

TR-CS The rsync algorithm. Andrew Tridgell and Paul Mackerras. June 1996

TR-CS The rsync algorithm. Andrew Tridgell and Paul Mackerras. June 1996 TR-CS-96-05 The rsync algorithm Andrew Tridgell and Paul Mackerras June 1996 Joint Computer Science Technical Report Series Department of Computer Science Faculty of Engineering and Information Technology

More information

Lecture Topics. Announcements. Today: Advanced Scheduling (Stallings, chapter ) Next: Deadlock (Stallings, chapter

Lecture Topics. Announcements. Today: Advanced Scheduling (Stallings, chapter ) Next: Deadlock (Stallings, chapter Lecture Topics Today: Advanced Scheduling (Stallings, chapter 10.1-10.4) Next: Deadlock (Stallings, chapter 6.1-6.6) 1 Announcements Exam #2 returned today Self-Study Exercise #10 Project #8 (due 11/16)

More information

OPERATING SYSTEM. Functions of Operating System:

OPERATING SYSTEM. Functions of Operating System: OPERATING SYSTEM Introduction: An operating system (commonly abbreviated to either OS or O/S) is an interface between hardware and user. OS is responsible for the management and coordination of activities

More information

OPERATING SYSTEMS. UNIT II Sections A, B & D. An operating system executes a variety of programs:

OPERATING SYSTEMS. UNIT II Sections A, B & D. An operating system executes a variety of programs: OPERATING SYSTEMS UNIT II Sections A, B & D PREPARED BY ANIL KUMAR PRATHIPATI, ASST. PROF., DEPARTMENT OF CSE. PROCESS CONCEPT An operating system executes a variety of programs: Batch system jobs Time-shared

More information

An Evaluation of the Dynamic and Static Multiprocessor Priority Ceiling Protocol and the Multiprocessor Stack Resource Policy in an SMP System

An Evaluation of the Dynamic and Static Multiprocessor Priority Ceiling Protocol and the Multiprocessor Stack Resource Policy in an SMP System An Evaluation of the Dynamic and Static Multiprocessor Priority Ceiling Protocol and the Multiprocessor Stack Resource Policy in an SMP System Jim Ras and Albert Mo Kim Cheng Outline Handling shared resources

More information

Multiprocessor and Real-Time Scheduling. Chapter 10

Multiprocessor and Real-Time Scheduling. Chapter 10 Multiprocessor and Real-Time Scheduling Chapter 10 1 Roadmap Multiprocessor Scheduling Real-Time Scheduling Linux Scheduling Unix SVR4 Scheduling Windows Scheduling Classifications of Multiprocessor Systems

More information

Operating System 4 THREADS, SMP AND MICROKERNELS

Operating System 4 THREADS, SMP AND MICROKERNELS Operating System 4 THREADS, SMP AND MICROKERNELS PROCESSES AND THREADS Process concept characteristics discussed so far Resource ownership Scheduling/execution These two characteristics are independent.

More information

Distributed Computing: PVM, MPI, and MOSIX. Multiple Processor Systems. Dr. Shaaban. Judd E.N. Jenne

Distributed Computing: PVM, MPI, and MOSIX. Multiple Processor Systems. Dr. Shaaban. Judd E.N. Jenne Distributed Computing: PVM, MPI, and MOSIX Multiple Processor Systems Dr. Shaaban Judd E.N. Jenne May 21, 1999 Abstract: Distributed computing is emerging as the preferred means of supporting parallel

More information

Using implicit fitness functions for genetic algorithm-based agent scheduling

Using implicit fitness functions for genetic algorithm-based agent scheduling Using implicit fitness functions for genetic algorithm-based agent scheduling Sankaran Prashanth, Daniel Andresen Department of Computing and Information Sciences Kansas State University Manhattan, KS

More information

Distributed Scheduling for the Sombrero Single Address Space Distributed Operating System

Distributed Scheduling for the Sombrero Single Address Space Distributed Operating System Distributed Scheduling for the Sombrero Single Address Space Distributed Operating System Donald S. Miller Department of Computer Science and Engineering Arizona State University Tempe, AZ, USA Alan C.

More information

ECE519 Advanced Operating Systems

ECE519 Advanced Operating Systems IT 540 Operating Systems ECE519 Advanced Operating Systems Prof. Dr. Hasan Hüseyin BALIK (4 th Week) (Advanced) Operating Systems 4. Threads Processes and Threads Types of Threads Multicore and Multithreading

More information

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture) EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture) Dept. of Computer Science & Engineering Chentao Wu wuct@cs.sjtu.edu.cn Download lectures ftp://public.sjtu.edu.cn User:

More information