Write a program in c language using threads and Basic priority scheduling for pintOS src thread

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.

Kemahiran: Pengaturcaraan C, Linux

Lihat lagi: sample program inventory sale using visual basic, write program generates phone numbers visual basic, sample program cash sales using visual basic, write program postfix evaluation using stack, write program class template using linked list, write program subtracts integers using bit registers, write program library management using, write program code udp using flow control, write a c program which can find the root of any function using secanet method, write some program in c language , Write an interactive program in C language to create an application program for your study centre. This application should be ha, Write a C# software using httpwebrequest, parser for c language using yacc, how to write a program in c language, write a c program to solve the given equation using bisection method, client server chat program in java using threads, one server multiple clients c socket using threads, atm program in java using threads, traffic light program in java using threads, are the basic building blocks in c language which are constructed together to write a c program

Tentang Majikan:
( 0 ulasan ) Detroit, United States

ID Projek: #31929366

4 pekerja bebas membida secara purata $20 untuk pekerjaan ini


Dear, client. Thank you for your posting. I've just read your description and guarantee 100% success on your job. Let's discuss about budget and deadline on private chat. Looking forward to hearing from you soon. Than Lagi

$20 USD dalam 7 hari
(18 Ulasan)

***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.

$20 USD dalam sehari
(6 Ulasan)

GOOD IN C PROGRAMMING HELLO DEAR CLIENT I have gone through your project details and the work is DOABLE since its within my area of EXPERTISE.I will tackle are required guideline to deliver desired goal Please consider Lagi

$20 USD dalam 2 hari
(0 Ulasan)

If you are looking for solution of C, C++, C# ,VB.NET, JAVA and Web Application in ASP.NET(MVC OR WEB FORMS), you are at right place. I am a professional developer with graduation in BS Software Engineering with more Lagi

$20 USD dalam 7 hari
(0 Ulasan)