Order for this Paper or Similar Assignment Writing Help

Fill a form in 3 easy steps - less than 5 mins.

Posted: November 23rd, 2022

Assignment Number: 2 Threads, Locks and Semaphores

Concurrent Programming
Module: CD
Semester: Semester I
Assignment Number: 2 Threads, Locks and Semaphores
Date of Title Issue: 17th Nov 2022
Assignment Deadline: 1st Dec 2022
Assignment Weighting: 15/60
Please state the assignment title / brief. Please specify details such as: Answer the questions on the accompanying sheet.
Learning Outcomes
Please state the programme and related module learning outcomes that this assignment is assessing. 1,2,4, 5,6
Assessment Criteria
Please state the assessment criteria applied to this assignment, such as:
• Correctness of the work.
• Presentation, including compliance with the specified file format.
• Evidence of critical thinking and analysis.
• Originality, quality and thoroughness of the work.
• Research correct academic approach.
• Proper treatment of sources.
• Demo of code will be in lab, failing to show work in lab receive deduction of 50% of total assignment grade.
Upload the answer as a multiple java file ONLY.
Academic Dishonesty: All of your assignments need to represent your own effort. Assignments should be done without consultation with other students and you should not share your source code with others. Any assignment submitted that is essentially the same, as someone else’s will not be accepted. ALL matching assignments will receive 0 credits.
Your task is to simulate of college and classrooms: There are four kinds of threads: students, visitors, monitor and a one Lecturer per classroom. students must wait to enter classroom if class is running, enter, and then sitDown. At some point, the Lecturer enters the classroom. When the Lecturer is in the classroom, no one may enter, and the students may not leave. visitors may leave. Once all students check in, the Lecturer can StartLecture. After some time, the Lecturer leaves and all students can leave.
To make these requirements more specific, let’s give the threads some functions to execute, and put constraints on those functions.
• students must invoke enter, sitDown, and leave.
• The Lecturer invokes enter, startLecture and leave.
• visitors invoke enter, sitDown and leave.
• While the Lecturer is in the classroom, no one may enter and students may not leave.
• The Lecturer cannot startLecture until all students who have entered have also sitDown.
• At any point of time any classroom may have only one lecturer.
• Classroom capacity should not exceed limit. Visitors are always low in count (less than 5).
• Add a monitor thread to keep printing the status of each class as follows
Simulate a college with few classrooms
{W201 (capacity 60), W202(capacity 60), W101 (Capacity 20), JS101 Capacity (30)} and lecturers {Osama, Barry, Faheem, Alex, Aqeel, Waseem} that circulate between classes.
Hints: Lecturer can use a binary semaphore to access classroom so one lecturer in class at any time students and visitors can use counted semaphores to access classroom. You can use locks, barriers, semaphores.
The running of the program should show something like the table below, that is updating every 2 seconds
==================================================================================
Classroom Lecturer InSession Students Visitors
==================================================================================
W201 Osama True 50 3
W202 Alex True 55 1
JS101 Faheem True 15 0
W101 False

Tags: , , , , , , , , , , ,

Why choose us

You Want Quality and That’s What We Deliver

Top Skilled Writers

Our writing team is assembled through a rigorous selection process, where we handpick accomplished writers with specialized expertise in distinct subject areas and a proven track record in academic writing. Each writer brings a unique blend of knowledge and skills to the table, ensuring that our content is not only informative but also engaging and accessible to a general college student audience

Discounted Prices

Competitive pricing is a cornerstone of our service, where we balance affordability with exceptional quality. In offering the best writers at rates that rival other writing services, we ensure that students can access top-notch content without breaking the bank unnecessarily. Our fair and transparent pricing structure is designed to provide value for money, making us a go-to choice for students seeking high-quality writing services at an affordable price.

100% Plagiarism-Free

Academic integrity is paramount to our writing service, which is why we produce original research and writing content for every paper. Each piece of work is carefully written from scratch, ensuring that every sentence, paragraph, and page is authentic and free from plagiarism. Our rigorous quality control process involves thorough scanning of every final draft, guaranteeing that the content meets the highest standards of originality and academic integrity. With keen attention to citation and referencing, we ensure that every source is properly credited, giving you complete peace of mind. We also have the best plagiarism checkers like safeassign and turnitin thus providing similarity score for each paper.

How it works

When you decide to place an order with Dissertation Help, here is what happens:

Complete the Order Form

You will complete our order form, filling in all of the fields and giving us as much detail as possible.

Assignment of Writer

We analyze your order and match it with a writer who has the unique qualifications to complete it, and he begins from scratch.

Order in Production and Delivered

You and your writer communicate directly during the process, and, once you receive the final draft, you either approve it or ask for revisions.

Giving us Feedback (and other options)

We want to know how your experience went. You can read other clients’ testimonials too. And among many options, you can choose a favorite writer.