Find Jobs
Hire Freelancers

Design and Implement

$30-5000 USD

Đã hoàn thành
Đã đăng vào gần 21 năm trước

$30-5000 USD

Thanh toán khi bàn giao
Design and implement a program to simulate processor scheduling. Theprogram will support round-robin scheduling. The program must maintain a ready queue and a list of waiting processes. The simulation will run in integer time steps. Input to the program will consist of the following information. No particular line fomat is [login to view URL] are to be separated by white space. int maxTimeSlice int snapshotInterval string processId int arrivalTime int cpuBurst int waitTime ... repeated cpu and wait pairs with final waitTime entry -1 Additional process descriptions follow until end of file Example (annotated): 10 50 P1 0 20 2 5 6 15 3 30 2 1 1 1 0 1 -1 P2 0 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 -1 P3 20 50 2 50 2 50 2 50 -1 P4 50 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 -1 P5 55 100 -1 Processor Scheduling Simulation Annotated Example Input (Annotation in parentheses): 10 (CPU Quantum) 50 (Snapshot Interval) P1 (Process Id) 0 (Arrival Time) 20 (CPU Burst 1) 2 (Wait Time 1) 5 (CPU 2) 6 (Wait 2) 15 (CPU 3) 3 (Wait 3) 30 (CPU 4) 2 (Wait 4) 1 (CPU 5) 1 (Wait 5) 1 (CPU 6) 0 (Wait 6) 1 (CPU 7) -1 (Sentinel) P2 0 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 -1 P3 20 50 2 50 2 50 2 50 -1 P4 50 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 -1 P5 55 100 -1 ## Deliverables Execution Example (corrected for time 30 on): Ready Processes are shown as ProcessId(RemainingCPUBurst) Running Processes are shown as ProcessId(EndOfCPUBurstTime;RemainingCPUBurst) EndOfCPUBurstTime = StartOfBurstTime + min(RemainingCPUBurst, CPUQuantum) Waiting Processes are shown as ProcessId(EndOfWaitTime) EndOfWaitTime = StartOfWaitTime + WaitTime Time Ready Running Waiting Comment 0 P2(5)->P1(20) Before dispatch 0 P2(5) P1(10;10) After dispatch 10 P1(10)->P2(5) Before dispatch 10 P1(10) P2(15;0) After dispatch 15 P1(25;0) P2(16) P2 waiting until 15+1 16 P2(5) P1(25;0) P2 done waiting 20 P3(50)->P2(5) P1(25;0) P3 arrives 25 P3(50) P2(30;0) P1(27) P1 waiting until 15+2 27 P1(5)->P3(50) P2(30;0) P1 done waiting 30 P1(5) P3(40;40) P2(31) P2 done running 31 P2(5)->P1(5) P3(40;40) P2 done waiting 40 P3(40)->P2(5) P1(45) 45 P3(40) P2(50;0) P1(51) 50 P4(5) P3(60;30) P2(51)->P1(51) P2 done, P4 arrives; Snapshot On each multiple of the snapshotInterval, the program will print a snapshot of the current state showing the time, the process in execution if any, the processes on the ready queue, in order, and the processes on the waiting list. When a process completes execution, the program will print the processId, the arrival time, start time (first time on CPU,) the completion time, the amount of CPU time used, and the amount of wait time for the process. Sample code: The program file, [login to view URL], is a schedule simulation for a multiprocessing batch system. It illustrates several techniques that may be useful in developing a solution to the assigned problem. The executable code, [login to view URL], and a test data file, [login to view URL], are available for you to run. To execute this program, download the exe file and the data file to your system and then enter the command [login to view URL] ## Platform Windows and Linux.
Mã dự án: 2950340

Về dự án

6 đề xuất
Dự án từ xa
Hoạt động 21 năm trước

Bạn muốn kiếm tiền?

Lợi ích khi chào giá trên Freelancer

Thiết lập ngân sách và thời gian
Nhận thanh toán cho công việc
Phác thảo đề xuất của bạn
Miễn phí đăng ký và cháo giá cho công việc
Đã trao cho:
Avatar người dùng
See private message.
$21,25 USD trong 14 ngày
4,9 (36 nhận xét)
3,8
3,8
6 freelancer chào giá trung bình $20 USD cho công việc này
Avatar người dùng
See private message.
$25,50 USD trong 14 ngày
4,9 (94 nhận xét)
4,3
4,3
Avatar người dùng
See private message.
$17 USD trong 14 ngày
4,9 (10 nhận xét)
3,8
3,8
Avatar người dùng
See private message.
$25,50 USD trong 14 ngày
4,9 (17 nhận xét)
3,3
3,3
Avatar người dùng
See private message.
$8,50 USD trong 14 ngày
4,5 (18 nhận xét)
2,4
2,4
Avatar người dùng
See private message.
$21,25 USD trong 14 ngày
5,0 (4 nhận xét)
2,3
2,3

Về khách hàng

Cờ của UNITED STATES
United States
4,7
16
Thành viên từ thg 4 19, 2003

Xác thực khách hàng

Cảm ơn bạn! Chúng tôi đã gửi email chứa đường link để bạn lấy tín dụng miễn phí.
Đã xảy ra lỗi trong khi gửi email của bạn. Hãy thử lại.
Người Dùng Đã Đăng Ký Tổng Số Việc Đã Đăng
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Đang tải xem trước
Đã cấp quyền truy cập vị trí.
Phiên đăng nhập của bạn đã hết hạn và bạn đã bị đăng xuất. Hãy đăng nhập lại.