Question

Q) Design a new Lottery CPU-scheduler. It must include details of any modifications you want to...

Q) Design a new Lottery CPU-scheduler. It must include details of any modifications you want to make to existing functions, methods, algorithms, formulae, and data structures. and where each addition will take place in. It must also include the same detailed description of any additional code. In the design document you should include how your algorithm distinguishes CPU-bound from I/O-bound, and user from system processes, how you designed it to prevent starvation, and how you think it will improve the responsiveness of the system.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Operating System | Lottery Process Scheduling

Prerequisite – CPU Scheduling, Process Management
Lottery Scheduling is type of process scheduling, somewhat different from other Scheduling. Processes are scheduled in a random manner. Lottery scheduling can be preemptive or non-preemptive. It also solves the problem of starvation. Giving each process at least one lottery ticket guarantees that it has non-zero probability of being selected at each scheduling operation.

In this scheduling every process have some tickets and scheduler picks a random ticket and process having that ticket is the winner and it is executed for a time slice and then another ticket is picked by the scheduler. These tickets represent the share of processes. A process having a higher number of tickets give it more chance to get chosen for execution.

Example – If we have two processes A and B having 60 and 40 tickets respectively out of total 100 tickets. CPU share of A is 60% and that of B is 40%.These shares are calculated probabilistically and not deterministically.

Explanation –

  1. We have two processes A and B. A has 60 tickets (ticket number 1 to 60) and B have 40 tickets (ticket no. 61 to 100).
  2. Scheduler picks a random number from 1 to 100. If the picked no. is from 1 to 60 then A is executed otherwise B is executed.
  3. An example of 10 tickets picked by Scheduler may look like this –
    Ticket number -  73 82 23 45 32 87 49 39 12 09.
    Resulting Schedule -  B  B  A  A  A  B  A  A  A  A.
    
  4. A is executed 7 times and B is executed 3 times. As you can see that A takes 70% of CPU and B takes 30% which is not the same as what we need as we need A to have 60% of CPU and B should have 40% of CPU.This happens because shares are calculated probabilistically but in a long run(i.e when no. of tickets picked is more than 100 or 1000) we can achieve a share percentage of approx. 60 and 40 for A and B respectively.

    Ways to manipulate tickets –

  5. Ticket Currency –
    Scheduler give a certain number of tickets to different users in a currency and users can give it to there processes in a different currency. E.g. Two users A and B are given 100 and 200 tickets respectively. User A is running two process and give 50 tickets to each in A’s own currency. B is running 1 process and gives it all 200 tickets in B’s currency. Now at the time of scheduling tickets of each process are converted into global currency i.e A’s process will have 50 tickets each and B’s process will have 200 tickets and scheduling is done on this basis.
  6. Transfer Tickets –
    A process can pass its tickets to another process.
  7. Ticket inflation –
    With this technique a process can temporarily raise or lower the number of tickets it own.

References –
Lottery scheduling – Wikipedia
eecs.berkeley.edu

Add a comment
Know the answer?
Add Answer to:
Q) Design a new Lottery CPU-scheduler. It must include details of any modifications you want to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Description In this homework, you are asked to implement a multithreaded program that will allow ...

    Description In this homework, you are asked to implement a multithreaded program that will allow us to measure the performance (i.e, CPU utilization, Throughput, Turnaround time, and Waiting time in Ready Queue) of the four basic CPU scheduling algorithms (namely, FIFO, SJE PR, and RR). Your program will be emulating/simulating the processes whose priority, sequence of CPU burst time(ms) and I'O burst time(ms) will be given in an input file. Assume that all scheduling algorithms except RR will be non-preemptive,...

  • please help!! hoose a Tool to Design Your Wireframes You may use any tool available to...

    please help!! hoose a Tool to Design Your Wireframes You may use any tool available to you that will allow you to create simple skeletal sketches of each screen or page, and to label the location of the key elements described in Part B of the assignment. You should save the sketches in one of the following formats: docx, .pptx, .sketch, .psd, .pdf, .png, .jpg, .gif, .png, or .rtf. Possible tools include Paint, PowerPoint, Word, Adobe Illustrator, Visual Studio, Visio,...

  • Referencing Figure 6.1: "Ten process design and improvement steps" on page 74 of the textbook, select...

    Referencing Figure 6.1: "Ten process design and improvement steps" on page 74 of the textbook, select one of the four defined phases. Use a business process example you are familiar with to explain the steps of the phase to a new hire on your team by describing how to perform each step in the identified example. 4:36 Aa 7» Q R 74 The ITSM Process Design Guide Maturity Assessments and Metrics performance and Continual Process Improvement Requirements Definition Requirements Definition...

  • A new version of the operating system is being planned for installation into your department’s production...

    A new version of the operating system is being planned for installation into your department’s production environment. What sort of testing would you recommend is done before your department goes live with the new version? Identify each type of testing and describe what is tested. Explain the rationale for performing each type of testing. [ your answer goes here ] Would the amount of testing and types of testing to be done be different if you were installing a security...

  • Map Crayola’s five pillars of operational leadership to the competitive priorities in Table 1.3 Create an...

    Map Crayola’s five pillars of operational leadership to the competitive priorities in Table 1.3 Create an assessment of Crayola’s competitive priorities as it relates to their Asian expansion plans Which of the competitive priorities might present the biggest challenge to Crayola as it expands internationally? VIDEO CASE Using Operations to Create Value at Crayola Operations processes are at the heart of Crayola, the Easton, Pennsylvania maker of crayons, markers, and paints loved by children of all ages around the world....

  • Please help writing a well structured document using the below Agile Runbook - Our Overall Delivery Process How do we initiate a Project? Any project is a response to a pain point or desire expresse...

    Please help writing a well structured document using the below Agile Runbook - Our Overall Delivery Process How do we initiate a Project? Any project is a response to a pain point or desire expressed by either customers, internal stakeholders, employees, or regulatory authorities. In short, a project is a time bound and specific goal oriented task-system that is born out of an ask from any stakeholder. Project initiation is laying down a new project by defining its goals, objectives,...

  • write a detailed summary in an organized format. It must include 3-4 key points of the...

    write a detailed summary in an organized format. It must include 3-4 key points of the controversy. Break up your summary in 3-4 paragraphs. Must include specific reasons as to why a vegetarian diet can be better and or worse than the meat heavy diets? Explain briefly using examples how reading this controversy has helped you in making better dietary choices in future? CONTROVERSY 6 Table of Contents Vegetarian and Meat-Containing Diets: What Are the Benefits and Pitfalls? Notebook LO...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

  • Because performance improvement activities are information intensive, organizations must provide the proper resources and systems to...

    Because performance improvement activities are information intensive, organizations must provide the proper resources and systems to support improvements. It’s important to recognize that PI programs need to meet accreditation standards such as The Joint Commission and Medicare and Medicaid Conditions of Participation, which require access to national comparative data collections. This assignment, based on a textbook case study, will help students to understand Joint Commission information management standards by analyzing how a scenario relates those standards. Instructions Your assignment will...

  • Because performance improvement activities are information intensive, organizations must provide the proper resources and systems to...

    Because performance improvement activities are information intensive, organizations must provide the proper resources and systems to support improvements. It’s important to recognize that PI programs need to meet accreditation standards such as The Joint Commission and Medicare and Medicaid Conditions of Participation, which require access to national comparative data collections. This assignment, based on a textbook case study, will help students to understand Joint Commission information management standards by analyzing how a scenario relates those standards. Instructions Your assignment will...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT