1 / 4

Assignment #1 -- Queueing System Simulation

Inter-arrival & service timefollows poisson distribution. FIFO Queue. Job generation. Statistics collector. J 6. J 5. J 4. J 3. J 2. J 1. Server. Assignment #1 -- Queueing System Simulation. Given a C program for a single queue single server system (qsys.c)

menora
Download Presentation

Assignment #1 -- Queueing System Simulation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Inter-arrival & service timefollows poisson distribution FIFO Queue Job generation Statistics collector J 6 J 5 J 4 J 3 J 2 J 1 Server Assignment #1 -- Queueing System Simulation • Given a C program for a single queue single server system (qsys.c) Based on this program, you are going to rewrite the followings and compare the performance between them. • The two programs you are going to write are: • A. single queue multiple servers (m1qsys.c) • B. multiple queues multiple servers (mmqsys.c) • For the sample program qsys.c: • To compile : gcc -o qsys qsys.c -lm (use g++ -o qsys_cpp qsys_cpp.cc -lm) • To run : qsys <arrival_time> <service_time> <sim_time> • Sample run : qsys 100.0 100.0 10000.0 • You can consider the time unit as msec (1000 msec = 1 second)

  2. Inter-arrival & Service time follow poisson distribution Server1 FIFO Queue Job generation Statistics collector J 6 J 5 J 4 J 3 J 2 J 1 Server2 Single-Queue-Multiple Servers Server3 FIFO Queues Inter-arrival & Service time follow poisson distribution J16 J15 J14 J13 J12 J11 Server1 Job generation Statistics collector J26 J25 J24 J23 J22 J21 Server2 J36 J35 J34 J33 J32 J31 Server3 Multiple-Queues-Multiple Servers Assignment #1 -- Two Queueing Systems

  3. Assignment #1 -- Input and Output • Input for the programs: • Assume your programs are called m1qsys.c and mmqsys.c: • Sample runs: program <# of servers> <arrival time> <service time> <sim time> • m1qsys 3 30.0 100.0 5000.0 (you may want to specify a longer sim_time) • mmqsys 3 30.0 100.0 5000.0 • Output for the programs: • Response time (max. & ave) : the time between the job entering and leaving the system. • Waiting time (max. & ave) : the time the job spent in the queue(s). • Queue length (max.) : the maximum queue length for each queue. • Importance note: • After rewriting the two programs, run them with the same set of parameters, and write a paragraph on their performance. • You should follow your simulation results and draw a conculsion stating which system is better.

  4. Assignment #2 -- First-Fit, Best-Fit, & Worst-Fit • You are going to simulate a computer system and evaluate 3 methods for loading processes into the main memory. • Main Memory: 16 Mbyte. • Simple segmentation system • The First-Fit algorithm is already written for you and you are going to add the Best-Fit and Worst-Fit algorithm to the program (loadmem.c or loadmem_cpp.cc) • For this sample program loadmem.c: • To compile : gcc -o loadmem loadmem.c -lm (for the C version) g++ -o loadmem_cpp loadmem_cpp.cc -lm (for the C++ version) • To run : loadmem {f|b|w} <p_min> <p_max> <s_min> <s_max> <arrival time> <sim time> • Sample run : loadmem f 500 2000 500 5000 200.0 30000.0 > loadmem.ffit • You can consider the time unit as msec (1000 msec = 1 second) • You can comment out the #define TURBOC statement in the program and compile the program under a Turbo C++ or Borland C++ compiler. I have tried it on Turbo C++ (version 3.0)

More Related