国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

CSCI 4210 — Operating Systems

時(shí)間:2024-08-19  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)


CSCI 4210  Operating Systems

Simulation Project Part II (document version 1.0)

Processes and CPU Scheduling

Overview

•  This assignment is due in Submitty by 11:59PM EST on Thursday, August 15, 2024

•  This project is to be completed either individually or in a team of at most three students; as with Project Part I, form your team within the Submitty gradeable, but do not submit any code until we announce that auto-grading is available

•  NEW: If you worked on a team for PartI, feel free to change your team for Part II; all code is reusable from Part I even if you change teams

•  Beyond your team (or yourself if working alone), do not share your code; however, feel free to discuss the project content and your findings with one another on our Discussion Forum

•  To appease Submitty, you must use one of the following programming languages:  C, C++, or Python (be sure you choose only one language for your entire implementation)

• You will have ve penalty-free submissions on Submitty, after which points will slowly be deducted, e.g., -1 on submission #6, etc.

• You can use at most three late days on this assignment; in such cases, each team member must use a late day

• You will have at least three days before the due date to submit your code to Submitty; if the auto-grading is not available three days before the due date, the due date will be 11:59PM EDT three days after auto-grading becomes available

•  NEW: Given that your simulation results might not entirely match the expected output on Submitty, we will cap your auto-graded grade at 50  points even though there will be more than 50 auto-graded points per language available in Submitty

• All submitted code must successfully compile and run on Submitty, which currently uses Ubuntu v22.04.4 LTS

• If you use C or C++, your program must successfully compile via gcc org++ with no warning messages when the -Wall  (i.e., warn all) compiler option is used; we will also use -Werror, which will treat all warnings as critical errors; the -lm flag will also be included; the gcc/g++ compiler is currently version 11.4.0 (Ubuntu  11.4.0-1ubuntu1~22.04)

•  For source file naming conventions, be sure to use * .c for C and * .cpp for C++; in either case, you can also include * .h files

• For Python, you must use python3, which is currently Python 3.10.12; be sure to name your main Python file project .py; also be sure no warning messages or extraneous output occur during interpretation

•  Please “flatten” all directory structures to a single directory of source files

•  Note that you can use square brackets in your code

Project specifications

For Part II of our simulation project, given the set of processes pseudo-randomly generated in Part I, you will implement a series of simulations of a running operating system. The overall focus will again be on processes, assumed to be resident in memory, waiting to use the CPU. Memory and the I/O subsystem will not be covered in depth in either part of this project.

Conceptual design  (from Part I)

process is defined as a program in execution.  For this assignment, processes are in one of the following three states, corresponding to the picture shown further below.

•  RUNNING: actively using the CPU and executing instructions

•  READY: ready to use the CPU, i.e., ready to execute a CPU burst

• WAITING: blocked on I/O or some other event

RUNNING                      READY                                   WAITING  (on  I/O) STATE                     STATE                                     STATE

+-----+                                                             +---------------------+

|           |          +-------------------+          |                                          |

|  CPU   |   <==  |         |         |         |         |              |         I/O  Subsystem          |

|           |          +-------------------+          |                                          |

+-----+           <<<  queue  <<<<<<<<<           +---------------------+

Processes in the READY  state reside in a queue called the ready queue.  This queue is ordered based on a configurable CPU scheduling algorithm.  You will implement specific CPU scheduling algorithms in Part II of this project.

All implemented algorithms (in Part II) will be simulated for the same  set  of processes, which will therefore support a comparative analysis of results. In Part I, the focus is on generating useful sets of processes via pseudo-random number generators.

Back to the conceptual model, when a process is in the READY state and reaches the front of the queue, once the CPU is free to accept the next process, the given process enters the RUNNING state and starts executing its CPU burst.

After each CPU burst is completed, if the process does not terminate, the process enters the WAITING  state, waiting for an I/O operation to complete (e.g., waiting for data to be read in from a file).  When the I/O operation completes, depending on the scheduling algorithm, the process either (1) returns to the READY  state and is added to the ready queue or (2) preempts the currently running process and switches into the RUNNING state.

Note that preemptions occur only for certain algorithms.

Algorithms — (Part II)

The four algorithms that you must simulate are first-come-first-served (FCFS); shortest job first (SJF); shortest remaining time (SRT); and round robin (RR). When you run your program, all four algorithms are to be simulated in succession with the same initial set of processes.

Each algorithm is summarized below.

First-come-first-served  (FCFS)

The FCFS algorithm is a non-preemptive algorithm in which processes simply line up in the ready queue, waiting to use the CPU. This is your baseline algorithm.

Shortest job first  (SJF)

In SJF, processes are stored in the ready queue in order of priority based on their anticipated CPU burst times.  More specifically, the process with the shortest predicted CPU burst time will be selected as the next process executed by the CPU. SJF is non-preemptive.

Shortest remaining time  (SRT)

The SRT algorithm is a preemptive version of the SJF algorithm. In SRT, when a process arrives, if it has a predicted CPU burst time that is less than the remaining predicted time of the currently running process, a preemption occurs.  When such a preemption occurs, the currently running process is added to the ready queue based on priority, i.e., based on its remaining predicted CPU burst time.

Round robin  (RR)

The RR algorithm is essentially the FCFS algorithm with time slice t slice.  Each process is given t slice  amount of time to complete its CPU burst. If the time slice expires, the process is preempted and added to the end of the ready queue.

If a process completes its CPU burst before a time slice expiration, the next process on the ready queue is context-switched in to use the CPU.

For your simulation, if a preemption occurs and there are no other processes on the ready queue, do not perform a context switch. For example, given process G is using the CPU and the ready queue is empty, if process G is preempted by a time slice expiration, do not context-switch process G back to the empty queue; instead, keep process G running with the CPU and do not count this as a context switch. In other words, when the time slice expires, check the queue to determine if a context switch should occur.

 

Simulation configuration  (extended from Part I)

The key to designing a useful simulation is to provide a number of configurable parameters. This allows you to simulate and tune for a variety of scenarios, e.g., a large number of CPU-bound processes, difering average process interarrival times, multiple CPUs, etc.

Define the simulation parameters shown below as tunable constants within your code, all of which will be given as command-line arguments. In Part II of the project, additional parameters will be added.

•  *(argv+1):  Define n as the number of processes to simulate.  Process IDs are assigned a two-character code consisting of an uppercase letter from A to Z followed by a number from

0 to 9. Processes are assigned in order A0, A1, A2, . . ., A9, B0, B1, . . ., Z9.

•  *(argv+2): Definen cpu as the number of processes that are CPU-bound. For this project, we will classify processes as I/O-bound or CPU-bound.  The n cpu   CPU-bound processes, when generated, will have CPU burst times that are longer by a factor of 4 and will have I/O burst times that are shorter by a factor of 8.

•  *(argv+3):  We will use a pseudo-random number generator to determine the interarrival times  of CPU bursts.  This command-line argument, i.e. seed, serves as the seed for the pseudo-random number sequence. To ensure predictability and repeatability, use srand48() with this given seed before simulating each  scheduling algorithm and drand48() to obtain the next value in the range [0.0, 1.0). Since Python does not have these functions, implement an equivalent 48-bit linear congruential generator, as described in the man page for these functions in C.

•  *(argv+4): To determine interarrival times, we will use an exponential distribution, as illus- trated in the exp-random .c example. This command-line argument is parameter λ; remember

that λ/1 will be the average random value generated, e.g., if λ = 0.01, then the average should be appoximately 100.

In the exp-random .c example, use the formula shown in the code, i.e., λ/− ln r.

•  *(argv+5):  For the exponential distribution, this command-line argument represents the upper bound for valid pseudo-random numbers.  This threshold is used to avoid values far down the long tail of the exponential distribution.  As an example, if this is set to 3000, all generated values above 3000 should be skipped. For cases in which this value is used in the ceiling function (see the next page), be sure the ceiling is still valid according to this upper bound.

•  *(argv+6): Define tcs  as the time, in milliseconds, that it takes to perform a context switch. Specifically, the first half of the context switch time (i.e., 2/tcs) is the time required to remove the given process from the CPU; the second half of the context switch time is the time required to bring the next process in to use the CPU. Therefore, require tcs  to be a positive even integer.

 

•  *(argv+7): For the SJF and SRT algorithms, since we do not know the actual CPU burst times beforehand, we will rely on estimates determined via exponential averaging.  As such, this command-line argument is the constant Q, which must be a numeric floating-point value in the range [0; 1].

Note that the initial guess for each process is τ0  = λ/1 .

Also, when calculating τ values, use the “ceiling” function for all calculations.

•  *(argv+8): For the RR algorithm, define the time slice value,t slice, measured in milliseconds. Require t slice  to be a positive integer.

Pseudo-random numbers and predictability  (from Part I)

A key aspect of this assignment is to compare the results of each of the simulated algorithms with one another given the same initial conditions, i.e., the same initial set of processes.

To ensure each CPU scheduling algorithm runs with the same set of processes, carefully follow the algorithm below to create the set of processes.

For each of the n processes, in order A0 through Z9, perform the steps below, with CPU-bound processes generated first. Note that all generated values are integers.

Define your exponential distribution pseudo-random number generation function as next_exp() (or another similar name).

1. Identify the initial process arrival time as the “floor” of the next random number in the sequence given by next_exp(); note that you could therefore have a zero arrival time

2. Identify the number of CPU bursts for the given process as the “ceiling” of the next random number generated from the uniform distribution obtained via drand48() multiplied by **; this should obtain a random integer in the inclusive range [1; **]

3. For each  of these CPU bursts, identify the CPU burst time and the I/O burst time as the “ceiling” of the next two random numbers in the sequence given by next_exp(); multiply the I/O burst time by 8 such that I/O burst time is close to an order of magnitude longer than CPU burst time; as noted above, for CPU-bound processes, multiply the CPU burst time by 4 and divide the I/O burst time by 8 (i.e., do not bother multiplying the original I/O burst time by 8 in this case); for the last CPU burst, do not generate an I/O burst time (since each process ends with a final CPU burst)

Simulation specifics  (Part II)

Your simulator keeps track of elapsed time t (measured in milliseconds), which is initially zero for each scheduling algorithm.  As your simulation proceeds, t  advances to each “interesting” event that occurs, displaying a specific line of output that describes each event.

The “interesting” events are:

•  Start of simulation for a specific algorithm

•  Process arrival (i.e., initially and at each I/O completion)

•  Process starts using the CPU

•  Process finishes using the CPU (i.e., completes a CPU burst)

•  Process has its τ value recalculated (i.e., after a CPU burst completion)

•  Process preemption (SRT and RR only)

•  Process starts an I/O burst

•  Process finishes an I/O burst

•  Process terminates by finishing its last CPU burst

• End of simulation for a specific algorithm

Note that the “process arrival” event occurs each time a process arrives, which includes both the initial arrival time and when a process completes an I/O burst. In other words, processes “arrive” within the subsystem that consists only of the CPU and the ready queue.

The “process preemption” event occurs each time a process is preempted.  When a preemption occurs, a context switch occurs, except when the ready queue is empty for the RR algorithm.

After you simulate each scheduling algorithm, you must reset your simulation back to the initial set of processes and set your elapsed time back to zero.

Note that there may be times during your simulation in which the simulated CPU is idle because no processes have arrived yet or all processes are busy performing I/O. Also, your simulation ends when all processes terminate.

If diferent types of events occur at the same time, simulate these events in the following order:

(a) CPU burst completion; (b) process starts using the CPU; (c) I/O burst completions; and

(d) new process arrivals.

Further, any “ties” that occur within  one of these categories are to be broken using process ID order.  As an example, if processes G1  and S9 happen to both complete I/O bursts at the same time, process G1 wins this “tie” (because G1 is lexicographically before S9) and is therefore added to the ready queue before process S9.

Be sure you do not implement any additional logic for the I/O subsystem.  In other words, there are no specific I/O queues to implement.

Measurements  (from Part I)

There are a number of measurements you will want to track in your simulation. For each algorithm, you will count the number of preemptions and the number of context switches that occur. Further, you will measure CPU utilization by tracking CPU usage and CPU idle time.

Specifically, for each  CPU  burst, you will track CPU burst time (given), turnaround time, and wait time.

CPU burst time

CPU burst times are randomly generated for each process that you simulate via the above algorithm. CPU burst time is defined as the amount of time a process is actually using the CPU. Therefore, this measure does not include context switch times.

Turnaround time

Turnaround times are to be measured for each process that you simulate.  Turnaround time is defined as the end-to-end time a process spends in executing a single  CPU  burst.

More specifically, this is measured from process arrival time through to when the CPU burst is completed and the process is switched out of the CPU. Therefore, this measure includes the second half of the initial context switch in and the first half of the final context switch out, as well as any other context switches that occur while the CPU burst is being completed (i.e., due to preemptions).

Wait time

Wait times are to be measured for each CPU burst. Wait time is defined as the amount of time a process spends waiting to use the CPU, which equates to the amount of time the given process is actually in the ready queue. Therefore, this measure does not include context switch times that the given process experiences, i.e., only measure the time the given process is actually in the ready queue.

CPU utilization

Calculate CPU utilization by tracking how much time the CPU is actively running CPU bursts versus total elapsed simulation time.

 

請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp



 

掃一掃在手機(jī)打開當(dāng)前頁
  • 上一篇:代寫COMP501 ICT Fundamentals
  • 下一篇:BISM1201代做、代寫Python/Java程序語言
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場(chǎng)仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲勞振動(dòng)
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個(gè)行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營技巧,多多開團(tuán)助手,多多出評(píng)軟件徽y1698861
    超全面的拼多多電商運(yùn)營技巧,多多開團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服務(wù)平臺(tái)
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 豆包網(wǎng)頁版入口 破天一劍 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    欧美激情亚洲视频| 久久久久久网站| 国产欧美日韩网站| 国产高清一区二区三区| 日本欧美中文字幕| 91精品国产综合久久久久久蜜臀 | 国产精品爽爽爽| 日本视频一区二区在线观看| 欧美极品视频一区二区三区| 久久久久久国产三级电影| 亚洲精品在线免费看| 福利精品视频| 久久成人一区二区| 国产精品视频免费一区| 欧美激情亚洲天堂| 国产成人精品视频| 色香蕉在线观看| 91久久在线视频| 欧美激情aaaa| 国产一区二区视频在线观看 | 国产欧美一区二区三区久久| 久久久久久亚洲| 青草成人免费视频| 国产成人精品av在线| 日韩在线观看a| 777精品久无码人妻蜜桃| 欧美激情亚洲一区| 国产乱码精品一区二区三区卡| 国产精品色悠悠| 欧美视频在线第一页| 久久久久日韩精品久久久男男| 亚洲一区二区在线播放| 国产女人精品视频| 欧美成人性色生活仑片| 精品少妇一区二区三区在线| 国产成人久久婷婷精品流白浆| 日韩激情视频一区二区| 久久国产精品网| 日韩视频精品| 久久精品99久久久香蕉| 欧美牲交a欧美牲交| 色av中文字幕一区| 琪琪亚洲精品午夜在线| 久久久久久久久久久久久9999| 日韩av大片在线| 国产精品678| 大j8黑人w巨大888a片| 久久精品午夜福利| 日本午夜精品电影| 国产精品免费视频一区二区| 免费在线黄网站| 自拍日韩亚洲一区在线| 91精品国产成人| 色阁综合av| 久久深夜福利免费观看| 日本视频久久久| 久久精品国产电影| 黄网站色视频免费观看| 欧美乱妇40p| 91精品视频大全| 日韩激情视频| 国产精品私拍pans大尺度在线| 国内精品久久久久久久久| 精品伦理一区二区三区| 国产精品中出一区二区三区 | 俺去了亚洲欧美日韩| 精品www久久久久奶水| 国产精品第七影院| 99在线免费视频观看| 日韩偷拍一区二区| 欧美成人性色生活仑片| 国产极品尤物在线| 欧美人成在线观看| 九九热这里只有精品6| 91精品久久久久久久久久入口| 欧美一区亚洲一区| 欧美日韩国产成人| 久久免费国产视频| 欧美有码在线观看| 国产99久久精品一区二区永久免费| 97福利一区二区| 欧美亚洲在线视频| 欧美精品久久久久a| 久久久久久久久久久免费精品 | 亚洲综合中文字幕在线| 色婷婷综合久久久久| 国产免费一区二区三区视频 | 色综合老司机第九色激情| 国产精品9999久久久久仙踪林| 国产一区二区免费电影| 日韩av免费电影| 久久av中文字幕| 久久久久久久久网| www亚洲国产| 日韩一二区视频| 久久中国妇女中文字幕| 成人精品视频在线播放| 日本免费高清一区二区| 精品不卡一区二区三区| 久久久久久这里只有精品| 国产一区二区三区精彩视频| 日韩免费观看高清| 亚洲欧洲日韩综合二区| 久热精品视频在线| 国产成人精品视频ⅴa片软件竹菊| 国产中文字幕视频在线观看| 日本一区二区三区四区高清视频 | 亚洲图片欧洲图片日韩av| 国产成人生活片| 久久久在线免费观看| 蜜桃视频在线观看91| 日韩av成人在线观看| 精品国产aⅴ麻豆| 久热精品视频在线| 久久一区二区三区欧美亚洲| 国产免费一区二区三区四在线播放 | 日本一区二区三区www| 国产精品色午夜在线观看| 国产传媒一区二区| www.日本少妇| 国产欧美一区二区三区另类精品| 热99精品里视频精品| 午夜精品一区二区三区在线视频 | 99久久自偷自偷国产精品不卡| 美女主播视频一区| 区一区二区三区中文字幕| 日本一区不卡| 久久久久久69| 一区二区视频在线播放| 国产精品电影观看| 国产精品精品软件视频| 色阁综合伊人av| 久久久国产成人精品| 日韩亚洲精品视频| 国产精品丝袜久久久久久高清| 视频直播国产精品| 久久久久亚洲精品国产| 国产原创精品| 精品一区二区三区无码视频| 欧美一区国产一区| 欧美激情国产高清| 久久久久久国产免费| 国产精品aaaa| 成人精品视频久久久久| www日韩av| 91精品国产综合久久香蕉的用户体验 | 国内精品久久久久久| 精品欧美一区免费观看α√| 欧美亚洲成人免费| 欧美久久在线| 国产午夜福利100集发布| 国产视频一区二区不卡| 丰满人妻中伦妇伦精品app| 成人免费观看cn| 91精品久久久久久久久久另类| 91传媒免费视频| 国产成人精品免费久久久久| 日韩中文娱乐网| 国产精品吹潮在线观看| 欧美黄网免费在线观看| 亚洲国产另类久久久精品极度| 亚洲一区美女视频在线观看免费| 亚洲永久激情精品| 日韩av免费一区| 秋霞午夜一区二区| 免费国产成人av| 国产美女作爱全过程免费视频| 成人黄色av网站| 国产成人精品免费视频| 国产精品视频专区| 精品蜜桃传媒| 亚洲a在线播放| 激情小视频网站| 成人中文字幕av| 菠萝蜜影院一区二区免费| 久久艹在线视频| 在线国产精品网| 欧美亚洲日本在线观看| 国产人妻互换一区二区| 久久精品日产第一区二区三区精品版| 国产成人精品午夜| 亚洲精品久久久久久一区二区| 日韩经典在线视频| www.久久草| 日韩中文字幕精品视频| 国产精品福利在线| 午夜精品亚洲一区二区三区嫩草| 青春草在线视频免费观看| www黄色日本| 色狠狠久久aa北条麻妃| 欧美日韩爱爱视频| 欧美一区二区.| 精品免费视频123区| 97碰碰碰免费色视频| 北条麻妃久久精品| 苍井空浴缸大战猛男120分钟| 久久精品女人的天堂av| 久久夜精品香蕉| 日韩一二三区不卡在线视频| 国产日韩一区二区三区|