OPERATING SYSTEMS 1 龚玲 lgong@sjtu.edu.cn
OPERATING SYSTEMS 龚玲 lgong@sjtu.edu.cn 1
REVIEW o Communication in Client-Server Systems o http://wenku.baidu.com/course/study/77fldcccda38376ba flfae94#665ea0c7aa00b52acfc7ca94
REVIEW Communication in Client-Server Systems http://wenku.baidu.com/course/study/77f1dcccda38376ba f1fae94#665ea0c7aa00b52acfc7ca94
CHAPTER 4:THREADS Operating System Concepts with Java-7th Edition,Nov 15,2006 Silberschatz,Galvin and Gagne 2007
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 CHAPTER 4: THREADS
CHAPTER 4:THREADS o Overview o Multithreading Models o Threading Issues o Pthreads o Windows XP Threads o Linux Threads o Java Threads
CHAPTER 4: THREADS Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads Java Threads
GOALS FOR TODAY o Why introduce thread? o What is the concept of thread?
GOALS FOR TODAY Why introduce thread? What is the concept of thread?
MOTIVATION APPLICATION EXAMPLES o Air ticketing system:dealing with several requests from the ticket windows at the same time. o Database software:dealing with several data requests from the clients. Operating system:dealing with multi requests for reading disk from several users. o Same situation:multi requests based on same data sections o Please design your solutions using process model and analyze the performance of your solutions
MOTIVATION APPLICATION EXAMPLES Air ticketing system: dealing with several requests from the ticket windows at the same time. Database software: dealing with several data requests from the clients. Operating system: dealing with multi requests for reading disk from several users. Same situation: multi requests based on same data sections Please design your solutions using process model and analyze the performance of your solutions
SOLUTION 1: o Use one process to deal with all the requests in order o Shortcomings: long waiting slow response lack of efficiency
SOLUTION 1: Use one process to deal with all the requests in order Shortcomings: long waiting slow response lack of efficiency
SOLUTION 2: o Use one process to deal with all the requests concurrently o Shortcomings: Increase the process's burden and complexity very hard to implement
SOLUTION 2: Use one process to deal with all the requests concurrently Shortcomings: Increase the process’s burden and complexity very hard to implement
SOLUTION 3: use several independent processes,each one handles one request o Shortcomings: need a lot of processes which use the same resource build the processes frequently switch the processes frequently huge overhead o Analysis the management information of the processes are similar the works of switching between the processes are similar
SOLUTION 3: use several independent processes, each one handles one request Shortcomings: need a lot of processes which use the same resource build the processes frequently switch the processes frequently huge overhead Analysis the management information of the processes are similar the works of switching between the processes are similar
NEW SOLUTION o deal with requests concurrently (avoid shortcomings of solution 1) o OS should take charge of the management (avoid shortcomings of solution 2) o low overhead(avoid shortcomings of solution 3)
NEW SOLUTION deal with requests concurrently (avoid shortcomings of solution 1) OS should take charge of the management (avoid shortcomings of solution 2) low overhead(avoid shortcomings of solution 3)