Order ID:89JHGSJE83839 | Style:APA/MLA/Harvard/Chicago | Pages:5-10 |
Instructions:
Question about the Operating Systems Project
You will create a program that will allow many chat bots to run simultaneously but asynchronously in their own threads. Each bot is responsible for writing the provided text message to a single, shared resource called QUOTE.txt. The bots must utilize an appropriate IPC mechanism/algorithm to avoid the data from being corrupted by other bots.
You’ll accomplish this by creating a project that manages many threads writing to a shared file (you’re not creating a chat server; the chat bots will all write to the same file).
Unless the instructor gives permission, you must work in pairs (teams of two).
When your software begins, it will perform the following tasks:
In the current directory, create a file called QUOTE.txt (cwd).
Have your process up and running. Its pid (Process ID) should be written into the file, followed by a carriage return and a newline.
QUOTE.txt should be closed.
Create a FLAG semaphore for the threads to use to control access to the file QUOTE.txt.
Make seven threads. Use the POSIX thread creation function (pthread create()).
Allow all seven threads to finish their work before blocking/waiting.
Destroy the semaphore when all threads are finished, then exit gracefully by writing a friendly message to the console.
Each thread must complete the following tasks (notice that each thread is active at the same time):
The semaphore FLAG is periodically received (even numbered threads once every two seconds, odd numbered threads once every three seconds); once the thread obtains FLAG, it will do the following:
Write the thread’s tid (thread id) followed by “The Quote” in the file QUOTE.txt (followed by a Carriage Return and Newline)
To the console, type (print to stdout) The phrase “thread is running” is followed by a newline.
QUOTE.txt should be closed.
FLAG, the semaphore, should be released.
Rep the process seven times more (they run a total of 8 times).
exit
For constructing and managing semaphores, you’ll need to use the POSIX system functions sem init(), sem wait(), sem post(), and sem destroy ().
I’ll compile and run your software on Edoras to see how it works. Your program must be written in such a way that it compiles and runs without errors using the gcc or g++ compilers. In your home directory, create a subdirectory called “a1.” It should contain your source files, header files, a Makefile (see Canvas for Makefile examples), and a README file (see Canvas for README requirements). Your source files MUST CONTAIN ENOUGH COMMENTS TO MAKE THEM EASILY READABLE. For sources that are badly (or not at all) commented, points will be deducted. The executable should be called “bots.”
By hand, make /a1.
Make source files, an include file, a Makefile, and a README file for your project. Place them in /a1.
In this directory, the Makefile will produce an executable named “bots” (/a1).
[https://computing.llnl.gov/tutorials/pthreads/] provides a good overview of threads.
It is not permitted to use the system call “system().”
On Monday, June 14, 2021, at 1700 (5:00 PM), the assignment is due.
SUBMISSION OF YOUR WORK:
Your project files should be uploaded to Assignment #1 on Canvas, in one of the team members’ class account. Make certain to write each one down.
Ensure that all of your files (all source files, Makefile, README file, test files, and so on) are located in the a1 subdirectory of one of your class accounts.
Create a single zip file or a tarball (tar file) with all project files before loading them onto Canvas. Then, in Assignment #1, attach the file (submit it) under Assignment Submission (only one team member turns in the assignment on Canvas). Attach the README file after that. Before submitting your project, specify both team members’ names and class accounts, as well as which account will be used for testing, and then submit your project.
The Proverb:
Even-numbered threads: Computer programming is all about controlling complexity.
Brian Kernigan’s quote
Threads with odd numbers: Computer science isn’t about computers any more than astronomy is about telescopes.
Dijkstra, Edsger
Please follow the aforementioned instructions… Don’t worry, Edoras will be submitting it from my end.
TBD |.doc file | C++ Requirements
RUBRIC |
||||||
Excellent Quality 95-100%
|
Introduction
45-41 points The background and significance of the problem and a clear statement of the research purpose is provided. The search history is mentioned. |
Literature Support 91-84 points The background and significance of the problem and a clear statement of the research purpose is provided. The search history is mentioned. |
Methodology 58-53 points Content is well-organized with headings for each slide and bulleted lists to group related material as needed. Use of font, color, graphics, effects, etc. to enhance readability and presentation content is excellent. Length requirements of 10 slides/pages or less is met. |
|||
Average Score 50-85% |
40-38 points More depth/detail for the background and significance is needed, or the research detail is not clear. No search history information is provided. |
83-76 points Review of relevant theoretical literature is evident, but there is little integration of studies into concepts related to problem. Review is partially focused and organized. Supporting and opposing research are included. Summary of information presented is included. Conclusion may not contain a biblical integration. |
52-49 points Content is somewhat organized, but no structure is apparent. The use of font, color, graphics, effects, etc. is occasionally detracting to the presentation content. Length requirements may not be met. |
|||
Poor Quality 0-45% |
37-1 points The background and/or significance are missing. No search history information is provided. |
75-1 points Review of relevant theoretical literature is evident, but there is no integration of studies into concepts related to problem. Review is partially focused and organized. Supporting and opposing research are not included in the summary of information presented. Conclusion does not contain a biblical integration. |
48-1 points There is no clear or logical organizational structure. No logical sequence is apparent. The use of font, color, graphics, effects etc. is often detracting to the presentation content. Length requirements may not be met |
|||
You Can Also Place the Order at www.collegepaper.us/orders/ordernow or www.crucialessay.com/orders/ordernow
Question about the Operating Systems Project |
Question about the Operating Systems Project