[SOLVED] 代写 concurrency There are three tasks in this project milestone. Since the code is missing in functionality, test programs may not pass until you correctly implement the required components. The tasks listed below assume you are already familiar with the code base (including and especially those we provided to you). Make sure you understand the code very well before attempting.

30 $

File Name: 代写_concurrency_There_are_three_tasks_in_this_project_milestone._Since_the_code_is_missing_in_functionality,_test_programs_may_not_pass_until_you_correctly_implement_the_required_components._The_tasks_listed_below_assume_you_are_already_familiar_with_the_code_base_(including_and_especially_those_we_provided_to_you)._Make_sure_you_understand_the_code_very_well_before_attempting..zip
File Size: 3607.86 KB

SKU: 9636047054 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


There are three tasks in this project milestone. Since the code is missing in functionality, test programs may not pass until you correctly implement the required components. The tasks listed below assume you are already familiar with the code base (including and especially those we provided to you). Make sure you understand the code very well before attempting.

2.1. Task 1 – Lock Manager [50 marks]

This task focuses on the logical level concurrency control, i.e., locking. You need to implement a simple lock manager based on the ideas discussed in class (here and here).

The basic idea is to use a hash table as the lock table to track all locks and requests. You will need to implement lock acquire, release and other related functions. In this task, you do not need to consider deadlocks (i.e., assume they will never occur), which you will handle in the next task. The design is self-explanatory in the code given to you in lock_manager.{h,cc} so we will not repeat here. Start by understanding the code and follow the comments to add your implementation. Note that a new Transaction type is defined in yase.h. You should use it for your lock manager implementation and finish implementing its Commit and Abort functions. Check lock_manager_mttest.cc to get an idea how everything fits together for this task.

2.2. Task 2 – Deadlock Prevention [30 marks]

Based on your implementation of Task 1, implement two policies: wait-die and no-wait. Under the wait-die policy, transaction Ti directly aborts if Tj is already holding the lock and Tj has higher priority (i.e., smaller timestamp). Under the no-wait policy, transaction Ti directly aborts if the lock cannot be granted immediately, regardless of priority.

The user code should be able to specify which policy to use by giving the corresponding constructor parameter to the lock manager; the parameter is already defined in the base code, you should use it in your lock manager code to decide which policy to take.

2.3. Task 3 – Testing Your Code [20 marks]

Under the Tests directory a new test program (lock_manager_mttest.cc) is given to get you started on testing your code. You need to add one new test for the no-wait policy. You can follow the similar idea of the given wait-die policy to write the new test. Your test must use at least two threads. We will test your code using more complex cases so you are encouraged to use this code as a starting point and vary as many parameters as possible to test your code.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] 代写 concurrency There are three tasks in this project milestone. Since the code is missing in functionality, test programs may not pass until you correctly implement the required components. The tasks listed below assume you are already familiar with the code base (including and especially those we provided to you). Make sure you understand the code very well before attempting.
30 $