Description - mybatman200/Concurrency-control-VCFS-File-System GitHub Wiki

The purpose of this assignment is to get you familiar with basic concurrency control topics in Java. We will build on the concepts of HW1 (the shell), focusing specifically on building a file management system. In particular: it has recently become more and more popular to organize files by keywords and tags, rather than by their location in a hierarchical filesystem. Users of Mac OS X might find themselves turning more to using Spotlight to open documents (rather than manually locating them in a hierarchical path), and Windows users might find themselves using Cortana to do the same.

The remainder of the assignments (and project) in this class will involve building parts of an intelligent file management tool, which you could use to browse and search through your files. We will call this tool VCFS (VeryCoolFileSystem).

Part 1: The Tag Database (20%) Your VCFS tool will allow users to maintain a list of Tags. In part 2, we’ll look at labeling files with tags. Users can interact with VCFS to create new tags, rename existing tags, and delete existing tags. The key focus for this part of the assignment will be to implement this functionality Thread Safe. You will likely find it very easy to implement this behavior that will work in a single-threaded situation, but it can become tricky when multiple threads are interacting with the same VCFS. Of the 20% that Part 1 will count towards your grade on this assignment, the breakdown will be roughly: 5% for implementing this functionality, and 15% for implementing it with correct concurrency control.

Once you allow users to create and edit tags, you will implement file-oriented functionality, allowing users to browse files, tag them, and edit those tags. The first method you will implement is init(List files);

This function will be called automatically when VCFS starts up. In init, you will initialize VCFS, creating a special starting tag “untagged.” Every file that exists (when VCFS starts) should receive this tag.

Part 4: Multi-threaded test cases (40%) We have included several functional tests that simply test the behavior of each of these methods. We have not provided any tests (for you to see) that test the behavior of your software under concurrency. One of your tasks is to write such tests.

Note that it is generally impossible to automatically prove that concurrent programs have no races, it is often to test for low-hanging fruit. For instance, you might create a handful of threads, and then repeatedly perform some operations in each thread, checking the system state to make sure that it doesn’t become corrupt. It can be difficult to get such tests to expose issues. We have written eight pretty good tests, which we used in the prior sections to grade the concurrency aspects of your code.

We are asking you to implement the same eight JUnit test cases (in the class edu.gmu.cs475.ConcurrentTests

Note that we have configured this test runner automatically to (1) automatically time out each test after 10 seconds, (2) automatically detect (most) deadlocks, and (3) to repeatedly rerun tests that passed in order to attempt to increase the odds of seeing it fail.

You should perform all of your testing on the provided FileManager instance ( edu.gmu.cs475.NonConcurrentTests.fileManager) – this field will be automatically reset for each execution of each test. You must only reference methods in AbstractFileManager, ITag and ITaggedFile (NOT FileManager, Tag, and TaggedFile) – since we will be grading the quality of your tests by running them on implementations of VCFS with known concurrency bugs. When we run our own test suite against these known buggy implementations, every test fails on every implementation. This is what you should strive for.

We can not provide the code for the buggy implementations to you because that might (1) give you tricks to make parts 1-3 easier, and (2) once you know what is buggy, you might find it easier to write the tests. However, you are free to submit as often as you like on AutoLab and see your marks.

Hints: Here is an example Java snippet that creates a bunch of threads, then waits for them to complete. This snippet also demonstrates keeping track of the number of successful operations, the number of failed operations, and the number of exceptions reported in each thread.

⚠️ **GitHub.com Fallback** ⚠️