Q.1 ) What is "Hashtable threadRRBTable", and what information do we store in it ? A.1 ) Think of it as a table, where we store requests made by threads. It contains an entry for every live thread (created but not killed yet), and the value for that entry is a RRB object which holds a pending request made by the thread. So this data structure basically holds the information of the request matrix (similar to need matrix in deadlock avoidance). eg. If the request matrix looks something like the following (where A,B,C,D are resource types) A B C D thread 1 0 0 2 0 thread 2 0 1 0 0 thread 3 0 0 0 0 thread 4 0 0 1 0 Then our threadRRBTable will have four entries, one for each thread. The entry for thread 1, will have a RRB object which holds the information "thread 1, has requested 2 instances of resource C", and we will have similar entry for thread 2, and 4 as well. But since thread 3, does not have any pending requests, we will store nullRRB for thread 3. Note that we’re using a Hashtable because our threads don’t have nice numbers as above. This way you can pass the Hashtable the ThreadCB Object and get the ResourcesCB and quantity back. Whenever the request of a thread is granted we replace it's entry with a nullRBB (usually when some other threads release resources). And whenever a thread is killed we remove it's entry from threadRRBTable, we do it in the do_giveupResources (Q.10) method in this project. Q.2) It looks like a thread can make a request for only one resource at a time, am I right ? A.2) Yes, in OSP's implementation a thread can only request instances of one resource type at a time. That is why storing only one RRB object against a thread suffices. If you see the example from the previous question you will find the row corresponding to every thread has at most one nonzero entry. If the request is granted, it can make another request. But if not granted the thread is suspended and cannot make any request until the pending request is granted. Q.3) Where can I find information about how many resources do we have? What are the resources do we have ? A.3) Information about a particular resource type is stored in corresponding ResourceCB object. We can find references to all such ResourceCB object from ResourceTable. So if we want to iterate through all Resource type we can do something like the following int nResources = ResourceTable.getSize(); for( int i = 0 ; i< nResources ; i++){ ResourceCB ithResource = ResourceTable.getResourceCB(i); } Q.4) Ok, but for deadlock detection, I need more information, the information stored in Allocation matrix and Available vector. How do I get them ? A.4) Provided we already have the ResourceCB object, we can know how many instance of the resource is available by invoking the resourceObject.getAvailable(). And if we want to know how many instance of that resource a particular thread has allocated, we can find out by calling resourceObject.getAllocated(thread). Q.5) For deadlock detection, the assignment mentioned about Work[] array ? How to initialize it, how do we know how big is it? how do we copy current available amount in to it. A.5) Work[] should initially have the available amount of each ResourceCB type in it. Specifically, Work[i] should contain the number of available instances of Resource with ResourceID = i. We can do it like the following int nResources = ResourceTable.getSize(); int Work[] = new int[nResources]; for( int i = 0 ; i