Implementation and Experimentation of Producer- Consumer Synchronization Problem 404210004 呂鴻洋 Introduction Producer-consumer problem is one classical.

Slides:



Advertisements
Similar presentations
Network II.5 simulator ..
Advertisements

Concurrent Programming James Adkison 02/28/2008. What is concurrency? “happens-before relation – A happens before B if A and B belong to the same process.
Operating Systems CMPSC 473 Mutual Exclusion Lecture 13: October 12, 2010 Instructor: Bhuvan Urgaonkar.
Informationsteknologi Wednesday, September 26, 2007 Computer Systems/Operating Systems - Class 91 Today’s class Mutual exclusion and synchronization 
The Architecture Design Process
1 Semaphores Special variable called a semaphore is used for signaling If a process is waiting for a signal, it is suspended until that signal is sent.
Graphics Annotation Usability in eLearning Applications Dorian Gorgan, Teodor Ştefănuţ Computer Science Department Technical University of Cluj-Napoca.
Chapter 9: Moving to Design
FIGURE 1-1 A Computer System
Fundamentals of Python: From First Programs Through Data Structures
Introduction to Systems Analysis and Design Trisha Cummings.
Research on cloud computing application in the peer-to-peer based video-on-demand systems Speaker : 吳靖緯 MA0G rd International Workshop.
Discrete Event Simulation in Automotive Final Process System Vishvas Patel John Ma Throughput Analysis & Simulations General Motors 1999 Centerpoint Parkway.
General What is an OS? What do you get when you buy an OS? What does the OS do? What are the parts of an OS? What is the kernel? What is a device.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings 1.
Chapter 11 Presentation Systems Implementation, Operation, and Control Computer System.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
INVITATION TO COMPUTER SCIENCE, JAVA VERSION, THIRD EDITION Chapter 6: An Introduction to System Software and Virtual Machines.
9 Systems Analysis and Design in a Changing World, Fourth Edition.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
9 Systems Analysis and Design in a Changing World, Fourth Edition.
Multithreading Chapter Introduction Consider ability of _____________ to multitask –Breathing, heartbeat, chew gum, walk … In many situations we.
Multithreading Chapter Introduction Consider ability of human body to ___________ –Breathing, heartbeat, chew gum, walk … In many situations we.
Chapter 3 System Performance and Models Introduction A system is the part of the real world under study. Composed of a set of entities interacting.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 24 Critical Regions.
C HU H AI C OLLEGE O F H IGHER E DUCATION D EPARTMENT O F C OMPUTER S CIENCE Preparation of Final Year Project Report Bachelor of Science in Computer Science.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
Semaphores Chapter 6. Semaphores are a simple, but successful and widely used, construct.
Software. Introduction n A computer can’t do anything without a program of instructions. n A program is a set of instructions a computer carries out.
7.1 Operating Systems. 7.2 A computer is a system composed of two major components: hardware and software. Computer hardware is the physical equipment.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
OPERATING SYSTEMS CS 3502 Fall 2017
Processes and threads.
Software Architecture
Performance Measurement of Processes and Threads Controlling, Tracking and Monitoring Based on Shared-Memory Parallel Processing Approach Asst. Prof.
CSCI-235 Micro-Computer Applications
GIS Application Management for Disabled People
Architecture Concept Documents
System Design Ashima Wadhwa.
2. Specification and Modeling
System Design.
The Client/Server Database Environment
Chapter 4 Computer Software.
An Introduction to Visual Basic .NET and Program Design
Chapter 9.3 Security Access Control
Applied Operating System Concepts
Chapter 10 Verification and Validation of Simulation Models
Communicating Ideas Design ideas can be communicated in different ways. Method of communication will depend on which stage the design work is at and who.
Introduction to Computers
Concurrency: Mutual Exclusion and Synchronization
Multithreading Chapter 23.
Introduction to Software Testing
Results, Discussion, and Conclusion
Operating Systems : Overview
What is Concurrent Programming?
An Introduction to Software Architecture
Operating Systems : Overview
Semaphores Chapter 6.
Multithreaded Programming
What is Concurrent Programming?
Lecture 18 Syed Mansoor Sarwar
Chapter 6 Synchronization Principles
Uncertainty-driven Ensemble Forecasting of QoS in Software Defined Networks Kostas Kolomvatsos1, Christos Anagnostopoulos2, Angelos Marnerides3, Qiang.
Presented By: Darlene Banta
Design Yaodong Bi.
Timing analysis research
Lecture 19 Threads CSE /6/2019.
Software Architecture
Presentation transcript:

Implementation and Experimentation of Producer- Consumer Synchronization Problem 404210004 呂鴻洋 Introduction Producer-consumer problem is one classical example of bounder buffer synchronization problems, and synchronization is needed to prevent errors such as consumers getting items out of the empty queue. The variations of producer-consumer problem can be run on both single and multi-processors systems. However, most of these simulators used for last studies only allow user to experiment in the context of a single producer and a single consumer. To address this limitation, we propose a simulator that allows user to study producer-consumer synchronization problem in three different contexts such as simple producer-consumer problem, producer-consumer problem in a single processor system and producer-consumer problem in multi-processing system. Conclusions This simulator provides a facility for the user to experiment with three different contexts such as simple producer- consumer problem, producer-consumer problem in a single processor system and producer-consumer problem in multi- processing system. In addition, users can carry out comparative evaluation among different contexts in a repeatable and controllable environment as to gain insight on the best model to use in certain situations. All developed modules of the simulator guarantee synchronization of processes and satisfy necessary requirements to provide solution to the critical section problem. Capability of running a trace-driven simulation can be incorporated in the existing system by developing a software module that can translate the trace of events recorded on a real system, into the format of input data file. The input data file so generated then can be used to run the simulation. Results This section presents the experiments that have been carried out to evaluate the efficiency of the simulator in simulating the different contexts of producer-consumer synchronization problem. We have performed a series of experiments by varying the input parameters as to study the following: 1.Relationship between Simulator Output and Elapsed Time: This experiment is aimed at quantifying the effect of elapsed time on the number of items produced and consumed. It is also meant to see the effects of elapsed time for the producer- consumer problem in single processor and multi-processor environments. For a single processor environment, we run three set of experiments with the following constant input parameters: three producers, three consumers, buffer size 10 and one CPU. We varied the elapsed time for each experiment. As for multi-processors environment, we have kept the same value of parameters except for number of CPUs. Figure 2 depicts the sample result of this experiment for three different elapsed time; 20, 40 and 60 seconds. The results attest that elapsed time have significant effects of number of items produced and consumed in both type of environments. Fig. 3 Simulation results for relationship between items produced/ consumed and number of CPUs 3. Relationship between Simulator Output and Buffer Size The performance of the simulator with regards to buffer size was computed via this experiment. In this case, the other entire parameters are kept constant and only buffer size is varied. Three sets of experiment have been conducted for three types of environment; single (set number of CPU to 1) and multiprocessor (set number of CPU to 2 and 3). The results for this experiment are depicted in Figure 4 with three different buffer sizes : 10, 15 and 20 . The results demonstrate that for all environments, simulator output (number of items produced and consumed) increases as the buffer size increases. They are not linearly proportional although the buffer size was increased linearly. Significant increased can be seen when buffer size was increased from 15 to 20. Materials and methods The simulator has been developed as a comprehensive software package which can run self-driven simulation, generates useful data and provides a user-friendly environment. The system is designed to run on Windows and is written using Java. There are 3 producer-consumer models, namely simple producer-consumer problem, producer-consumer problem in single processor environment, and producer-consumer problem in multi-processor environment. Figure 1 presents the class diagram used for the simulator. There are 5 major classes, listed as followed: ProducerConsumerAppletClass: This is the main class of a Java applet file for the simulator IntQueueClass: This class contains the control of execution of the producer and consumer. ProducerClass: Producer's main activity is to call the enqueue method in IntQueue class ConsumerClass: Consumer's main activity is to call the dequeue method in IntQueue class MessageCanvas Class: This class provides message canvas for the applet GUI Literature cited Stefano, A. D., Bello, L. L., Santoro, C.1997. Synchronous Producer-consumer transactions for real- time distributed process control. In Proceedings of the IEEE International Workshop on Factory Communication Systems. Juiz, C., Puigjaner, R. 1995. Improved performance model of a real-time software element: the producer- consumer. In Proceedings of the Second International Workshop on Real-Time Computing Systems and Applications. Zhang, Y., Zhang, J., Zhang, D. 2009. Implementing and testing Producer-consumer problem using aspect- oriented programming. In Proceedings of the Fifth International Conference on Information Assurance and Security. Shen, C. 2000. Discrete-event simulation on the Internet and the web. Future Generation Computer Systems, vol. 17, 187-196. Hilzer, Jr., R. C. 1992. Synchronization of the Producer/Consumer problem using semaphores, monitors, and the Ada Rendezvous. Operating Systems Review, vol. 26, 31-39. Robbins, S. 2000. Experimentation with bounded buffer synchronization. In Proceedings of the 31st SIGCSE Technical Symposium on Computer Science Education. Fig. 4 Fig. 2 Simulation results for relationship between items produced/consumed and elapsed time for single and multi-processors environments 2.RelationshipbetweenSimulatorOutputand Number of CPUs To study this relationship, we performed three sets of experiments with the following constant input parameters: three producers, three consumers, buffer size 10 and elapsed time of 20 seconds. Each set of experiment has been run with different number of CPUs. Output of the simulator is measured in terms of number of items produced and items consumed. Figure 3 shows a sample result for this experiment. The results show that the output of the system increases as the number of CPUs increases.