Hi everyone, I had not post much but had really gained a lot in reading relevent postings. The followings are my results: Grade: P Score: 353 Comment: This report shows the total number of points awarded for each section. The maximum number of points is 400, to pass you need a score of 320. Section summary: Section Max Actual Points Points General con: 100 86 Documentation: 70 60 OOD: 30 30 GUI: 40 27 Locking: 80 80 Data Store: 40 40 Network Server: 40 30 Total: 400 353
Hi Shu Gao, I used thread queue for the locking. Part of the choices.txt: There are 3 elements to the thread queue mechanism, Object ClientID a unique Data object, Hashtable lockTable to store which record is being locked and to store a LockElement,(which include a current lock ClientId, a boolean lock and a LinkList waitingList) corresponding to this record, and LinkedList WaitingList to store all the waiting threads which wait for the same record. Due of the thread queue mechanism, threads wanting to access the same record can be executed one after one in the sequential order (first in first out with LinkedList objects) and then make basic thread safe. And no waiting thread consumes CPU cycles until it is waken up.