Two Algorithms Optimistic Resource Manager 2683941

input/expected output:
language: c, python, or java
basically, two algorithms: optimistic resource manager (one that grants every request as soon as it comes in) and then banker Document Preview:

OS 202 2017-18 Spring Lab 3 Banker Page 1The goal of this lab is to do resource allocation using both an optimistic resource manager and the banker’salgorithm of Dijkstra. The optimistic resource manager is simple: Satisfy a request if possible, if not makethe task wait; when a release occurs, try to satisfy pending requests in a FIFO manner.Your program takes one command line argument, the name of the le containing the input. After reading(all) the input, the program performs two simulations: one with the optimistic manager and one with thebanker. Output is written to stdout (the screen). Input les are available on the web, together with theexpected output. We may test your program on additional input as well.The input begins with two values T, the number of tasks, and R, the number of resource types, followed byR additional values, the number of units present of each resource type. (If you set arbitrary limits” on sayT or R, you must document this in your readme, check that the input satises the limits, print an error if itdoes not, and set the limits high enough so that the required inputs all pass.) Then come multiple inputs,each representing the next activity of a specic task. The possible activities are initiate, request, release,and terminate. Time is measured in xed units called cycles and, for simplicity, no fractional cycles are used.The manager can process one activity (initiate, request, or release) for each task in one cycle. However, theterminate activity does not require a cycle.To ease the programming, I have specied all activities to have the same format, namely a string followedby four unsigned integers.The initiate activity, which must precede all others for that task, is writteninitiate task-number delay resource-type initial-claim(The optimistic manager ignores the claim.) If there are R resource types, there are R initiate activities foreach task, each requiring one cycle. The delay value is not used for initiate;…



Prof. Angela


Calculate Price

Price (USD)
Open chat