Write My Paper Button

WhatsApp Widget

functionality of threading system in Pintos – My Assignment Tutor

CIS 545 Project 2 (Due Oct. 27)Fall 2021 In this project, your tasks are to extend the functionality of threading system in Pintos (CSU version). To uncompress and extract the source code of Pintos (CSU version), login a Linux workstation in our Linux cluster and type tar xvf z-cis345s/pub/pintos_csu.tar.gz You will he working primarily in the ‘threads’ directory for this assignment, with some work in the ‘devices’ directory on the side. Compilation should be done in the ‘threads’ directory. The Pintos reference material can be found in: -cis345s/pub/PintosCSU_Ref .pdfTask 1: Efficient Alarm Clock In Pintos, threads may call this function to put themselves to sleep: /** * This function suspends execution of the calling thread until time has * advanced by at least x timer ticks. Unless the system is otherwise idle, * thread need not wake up after exactly x ticks. Just put it on the ready queue * after they have waited for the right number of ticks. The argument to * timer_sleep() is expressed in timer ticks, not in milliseconds or any another * unit. There are TIMER_FREQ timer ticks per second, where TIMER_FREQ is a * constant defined in devices/timer.h (spoiler: it’s 100 ticks per second). */ void timer_sleep (int64_t ticks); timer_sleep 0 is useful for threads that operate in real-time (e.g. for blinking the cursor once per second). The current implementation of timer_sleep() is inefficient, because it calls thread_yield() in a loop until enough time has passed. Your task is to re-implement timer_sleep() so that it executes efficiently without any “busy waiting”. That is, your implementation has to use an ordered list so that any thread calling timer_sleep() will be inserted to the list until its timer expires. The thread’s state has be changed to THRD_SLEEP when it is in the sleeping list. Task 2: Basic Priority SchedulingIn Pintos, each thread has a priority value ranging from 0 (PRIO_MIN) to 63 (PRIO_MAX). However. the current scheduler does not respect these priority values. You must modify the scheduler so that higher-priority threads always run before lower-priority threads. You must also modify the two Pintos synchronization primitives (lock and semaphore), so that these shared resources prefer higher-priority threads over lower-priority threads. A thread may set its own priority by calling thread_set_priority(int new_priority) and get its own priority by calling thread_get_priority(). If a thread no longer has the highest priority (e.g. it called thread_set_priority0 with a low value, it released a lock, or incremented semaphore value), it must immediately yield the CPU to the highest-priority thread.Scanned with CamScanner

CLAIM YOUR 30% OFF TODAY

X
Don`t copy text!
WeCreativez WhatsApp Support
Our customer support team is here to answer your questions. Ask us anything!
???? Hi, how can I help?