C代写:CS414 Mutex

代写OS作业,比较杂的一个作业。

Requirement

You may use general ideas you find online and from others, but your solution must be your own. When asked to explain something, don’t copy and paste text found online. Explain the idea in your own words.

Q1

C and C++ language has built-in memory functions for dynamic memory allocation. These functions are usually slow without memory leak detection. Develop your custom memory allocator in C/C++, with memory leak detection. Write clearly, the limitations and assumptions of your proposed memory allocation scheme.

Q2

Develop an application in C/C++ to display the partition table and file system in your system. As discussed in the lectures, the partition table lists the MBR and partitions in the computer.

Q3

Is it possible for the two threads to deadlock by concurrent calls to the functions A and B below? If so, give an example of an execution trace that leads up to deadlock.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void A () {
...
pthread_mutex_lock (&M2);
pthread_mutex_lock (&M1);
... critical section ...
pthread_mutex_unlock (&M1);
pthread_mutex_unlock (&M2);
}

void B () {
...
pthread_mutex_lock (&M1);
pthread_mutex_lock (&M2);
... critical section ...
pthread_mutex_unlock (&M2);
pthread_mutex_unlock (&M1);
}

Q4

Develop a source code for Banker algorithm in C/C++- you can choose arbitrary number of resources and processes as a test case.

Q5

Write the summary for the following published paper. Silas Boyd-Wickizer, Austin T. Clements, Yandong Mao, Aleksey Pesterev, M. Frans Kaashoek, Robert Morris, and Nickolai Zeldovich “An Analysis of Linux Scalability to Many Cores”, OSDI 2010. Submit your report using the Latex Template from USENIX webpage.

Q6

Write 2 page critique for the following paper

  • For students with an even student id. Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield. Xen and the Art of Virtualization Proceedings of the 19th ACM Symposium on Operating Systems Principles, October 2003.

  • For students with odd student id.
    Keith Adams and Ole Ageson. A Comparison of Software and Hardware Techniques for x86 Virtualization. Proceedings of the Twelfth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS XII), October 2006, San Jose, CA.