directory on the side Compilation should be done in the 'threads' directioy. The Pintos reference material can be found in: -cis345s/pub/[login to view URL] .pdf
Task I: Efficient Alarm Clock
In Pintos. threads may, call this function to put themsehes to sleep
•This function suspends execution of the call, thread until time hasadvanced by at least x timer ticks. Unless the system is otherwise idle, the 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 anotherunit . There are TIMER_FREP timer ticks per second where TIMER_FREQ is a constant defined in devices/timer .h (spoiler: .t's 100 ticks per second). void timer_sleep (int64_t, ticks);
t timer sleep() is useful for threads that operate in real-time (e g. lot blinking the cursor once per second). The current implementation of [login to view URL]() 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 an -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 Scheduling
In Pintos. each thread has a priority value ranging from 0(PRIO_MIN) to 63(PRIO_MAX). However. the current schedule, 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_get_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 [login to view URL] () with a low value, it released a lock. or incremented semaphore value) it must immediately yield the CPU the highest-prioritry thread.
To completely test your implementation, invoke make check from the project build directory. This will build and run each test and print a "pass" or "fail message for each one. When a test fails, make check also prints some details of the reason for failure. After running all the tests, make check also prints a summary of the test results
You can also run individual tests one at a time. A given test t writes its output to '[login to view URL]', then a script scores the output as "pass" or "fail and writes the verdict to '[login to view URL] run and grade a single test, make the result' file explicitly from the 'build directory, e.g.
make tests/threads/alarm-multiple result. If make says that the test result is up-to-date, but you want to re-run it anyway, either run make clean or delete the output file by hand.
4 pekerja bebas membida secara purata $20 untuk pekerjaan ini
***Easy for me*** I have good experience in kind of this project. If you hire me, you will get the highest quality result. Looking forward to hearing from you. Warm regards.