The purpose of this project is to familiarize yourself with the design and implementation issues of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The purpose of this project is to familiarize yourself with the design and implementation issues of a user- level thread package on PC/Linux. You need to use the tar command with the options xvfz to uncompress and extract files from "cis620s/pub/xt.tar.gz to your working directory. Part I The thread package which we discussed in the class is non-preemptive. That is, a thread can run to comple- tion unless it yields the control to other threads. For the first part of this assignment, you need to make the threads preemptive. You can use signal and ualarm to provide a clock interrupt every 0.01 second. When the clock interrupt occurs, the interrupt handler suspends the current running thread and finds a runnable thread to run. On PC/Linux, you need sigemptyset, sigaddset, and sigprocmask to unblock the SIGALRM signal to allow the next SIGALRM delivered. Add more comments to the source code. Part II You also need to enhance the thread library with the event mechanism. The events are declared as variables with a data type xthread_event_t. The following three functions have to be implemented: void xthread_init_ev (xthread_event_t *e); The event pointed by e is initialized as NOT_OCCURRED when xthread_init_ev () is invoked. void xthread_wait_ev (xthread_event_t *e) ; The function xthread_wait_ev () will place the calling thread on a queue of threads if the event pointed by e has not occurred. Otherwise, the calling thread continues to execute and the event is set to be NOT_OCCURRED. void xthread_set_ev (xthread_event_t *e) ; When a thread does a xthread_set_ev() operation on the event pointed by e, ALL of the waiting threads are allowed to continue processing and the event will be reset to NOT OCCURRED. If there are no queued processes, the event will be set as OCCURRED. Note that if the SIGALRM occurs during the execution of thread creation/completion, event wait/set, etc., the process table may lead to an inconsistent state (why? Give an example in your report). To solve this problem, you can use usec ualarm (0,0); ualarm (usec, 0); to disable the timer interrupt at the function entrance and restore it before the function returns. 1 Turnin Each group (two students) has to submit your report and program electronically. You have to put your report file (i.e. report.pdf) under the xt dir. Before you submit, you need to use make clean to clean all of the object/executable files. Then, on grail, change the directory to the parent directory of the xt dir and use the following command to submit the whole xt dir: turnin -c cis620s -p proj2 xt Your report should include the description of your code, the thread state transition diagram, experiences in debugging and testing, the project status (working or not), etc. The cover page should contain your pictures, names and the login id you used to turnin the project. Start on time and good luck. If you have any questions, send e-mail to j. sang@csuohio.edu. The purpose of this project is to familiarize yourself with the design and implementation issues of a user- level thread package on PC/Linux. You need to use the tar command with the options xvfz to uncompress and extract files from "cis620s/pub/xt.tar.gz to your working directory. Part I The thread package which we discussed in the class is non-preemptive. That is, a thread can run to comple- tion unless it yields the control to other threads. For the first part of this assignment, you need to make the threads preemptive. You can use signal and ualarm to provide a clock interrupt every 0.01 second. When the clock interrupt occurs, the interrupt handler suspends the current running thread and finds a runnable thread to run. On PC/Linux, you need sigemptyset, sigaddset, and sigprocmask to unblock the SIGALRM signal to allow the next SIGALRM delivered. Add more comments to the source code. Part II You also need to enhance the thread library with the event mechanism. The events are declared as variables with a data type xthread_event_t. The following three functions have to be implemented: void xthread_init_ev (xthread_event_t *e); The event pointed by e is initialized as NOT_OCCURRED when xthread_init_ev () is invoked. void xthread_wait_ev (xthread_event_t *e) ; The function xthread_wait_ev () will place the calling thread on a queue of threads if the event pointed by e has not occurred. Otherwise, the calling thread continues to execute and the event is set to be NOT_OCCURRED. void xthread_set_ev (xthread_event_t *e) ; When a thread does a xthread_set_ev() operation on the event pointed by e, ALL of the waiting threads are allowed to continue processing and the event will be reset to NOT OCCURRED. If there are no queued processes, the event will be set as OCCURRED. Note that if the SIGALRM occurs during the execution of thread creation/completion, event wait/set, etc., the process table may lead to an inconsistent state (why? Give an example in your report). To solve this problem, you can use usec ualarm (0,0); ualarm (usec, 0); to disable the timer interrupt at the function entrance and restore it before the function returns. 1 Turnin Each group (two students) has to submit your report and program electronically. You have to put your report file (i.e. report.pdf) under the xt dir. Before you submit, you need to use make clean to clean all of the object/executable files. Then, on grail, change the directory to the parent directory of the xt dir and use the following command to submit the whole xt dir: turnin -c cis620s -p proj2 xt Your report should include the description of your code, the thread state transition diagram, experiences in debugging and testing, the project status (working or not), etc. The cover page should contain your pictures, names and the login id you used to turnin the project. Start on time and good luck. If you have any questions, send e-mail to j. sang@csuohio.edu.
Expert Answer:
Answer rating: 100% (QA)
Answer Heres a highlevel overview of the tasks you need to perform for Part I and Part II Part I Pre... View the full answer
Related Book For
Research Methods For Business Students
ISBN: 9781292208787
8th Edition
Authors: Mark Saunders, Philip Lewis, Adrian Thornhill
Posted Date:
Students also viewed these programming questions
-
Compare and contrast ROR using different definitions of airport assets, including revenue generator, public service, safety, and security infrastructure.
-
what ways do post-translational modifications, such as acetylation and phosphorylation, intricately regulate metabolic enzymes to fine-tune metabolic flux and coordinate cellular responses to...
-
Case Analysis Critical thinking, creativity, and problem-solving are among some of the top skills needed by employers in the supply chain industry. This assignment will stretch your critical...
-
Each table of values gives several points that lie on a line.(a) What is the x-intercept of the line? The y-intercept?(b) Which equation in choices AD corresponds to the given table of values?(c)...
-
State three commonly used research methods in behavioral science.
-
A candlestick chart is similar to a bar chart except that the candlestick chart: A. Represents upward movements in price with Xs. B. Also graphically shows the range of the periods highs and lows. C....
-
When may extinguishment of debt occur? List the various ways in which extinguishment of debt occurs.
-
The physicians in Problem 3-34 have been approached by a market research firm that offers to perform a study of the market at a fee of $5,000. The market researchers claim their experience enables...
-
eBook Problem Walk-Through Bond Valuation with Semiannual Payments Renfro Rentals has issued bonds that have an 11% coupon rate, payable semiannually. The bonds mature in 15 years, have a face value...
-
Dawn is transporting 500 kg of Class 5.1 CAESIUM NITRATE. After skidding off the road to avoid a collision, she discovers about 10 kg of the flammable solid has been released. There were no road...
-
If the direct costs for a given program are $520,000. When applying a markup of 18% to cover indirect costs and overhead and planning on a 10% profit, what would be your submittal amount?
-
Responder ampliamente cada una de estas preguntas. 1. Cuales son los retos que enfrenta una empresa al lanzar una campaa 100% digital? 2. Que gana una marca que ha tenido mayor presencia en medios...
-
Rewrite the expression as the logarithm of a single quantity. log 3 7 + log 3 m O log 6 (7 + m) O log 3 7m Olog 3 (7 + m) Olog 6 7m
-
Describe how a healthy business culture contributes to organizational success. Provide at least two specific examples .
-
Using this two links help me with the text down below https://drive.google.com/file/d/1aXgG5jNcvljPdOC4U6zpIOVV-xreTlw7/view?usp=drivesdk...
-
write SQL code to enter the details of 10 customers such as name, address, age, email, mobile number and the loan balance amount. The output should show all the details of at least 10 customers. Draw...
-
After graduating with a Master's Degree in Computer Science, Zephan decided to start his own tech company. In order to pay for computing power and other services, Zephan took out a single loan of $...
-
Consider the circuit of Fig. 7.97. Find v0 (t) if i(0) = 2 A and v(t) = 0. 1 3 ett)
-
What are the principal ethical issues you will need to consider irrespective of the particular research methods that you use?
-
The following extract and associated references are taken from the first draft of a critical literature review. The research project was concerned with the impact of changes to UK legal aid...
-
In relation to your proposed research project, evaluate your scope to use: a. A traditional approach; b. An Internet- or intranet-mediated approach; c. A hybrid access strategy to gain access to...
-
Explain the difference between a deferred tax liability and a deferred tax asset.
-
How are deferred tax accounts presented on the balance sheet?
-
Suppose Wilson Company has one item that gives rise to a temporary difference and that item is expected to continue indefinitely. Specifically, Wilson prepays the following year's annual rent of \(\$...
Study smarter with the SolutionInn App