two algorithms: optimistic resource manager… 1 answer below »

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 1 The goal of this lab is to do resource allocation using both an optimistic resource manager and the banker’s algorithm of Dijkstra. The optimistic resource manager is simple: Satisfy a request if possible, if not make the 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 the banker. Output is written to stdout (the screen). Input les are available on the web, together with the expected 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 by R additional values, the number of units present of each resource type. (If you set arbitrary limits” on say T or R, you must document this in your readme, check that the input satis es the limits, print an error if it does 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 speci c 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, the terminate activity does not require a cycle. To ease the programming, I have speci ed all activities to have the same format, namely a string followed by four unsigned integers. The initiate activity, which must precede all others for that task, is written initiate task-number delay resource-type initial-claim (The optimistic manager ignores the claim.) If there are R resource types, there are R initiate activities for each task, each requiring one cycle. The delay value is not used for initiate;…


Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.