Monday, 2 April 2018

Process Synchronization using C/Linux and Java | Information Technology

Implement the following project using:
  1. C/Linux, and
  2. Java
  3. A class of 20 students is waiting to find out whether they will graduate. In order to graduate, they need to wait for S teachers to submit their grades for classes A, B, C, D and E. The teachers always submit the grades in the same order (i.e., they will each submit the grade for student 1 first, followed by those for student 2, etc…) but not at the same rate. Their rate of submission is the following for each teacher:
Screenshot (128)
They submit their grades to the same database. Only one process can access that database at a time.

                                                                                                             

Decisions on graduation will depend on each student’s weighted average grade on courses A, B, C, D and E. Courses A, C and E have a weight of 1, whereas courses 8 and D have a weight of 2. A student needs a weighted average of 75/100 to graduate.
In order to balance processing costs and graduation announcement speed, the graduation results will be announced every time 3 graduation announcements are ready or, for the last one, possibly fewer than three announcements are made but no student remains to be processed. Every time such a three-graduation (or fewer) announcement is posted, the time of the announcement must also be posted.
Using Threads and Semaphores, write a program to synchronize the processing of students, filling out of the database, calculation of the weighted average, and posting of graduation results. Please assume that the five teachers representing courses A to E, respectively, are each simulated by a separate thread. The procedure calculating students’ weighted average and making a decision on whether they can graduate or not is implemented using an independent thread. The procedure posting the graduation announcements is also implemented using an independent thread. All these threads need to be coordinated as per the scenario described above.

No comments:

Post a Comment

Recent Questions

Learn 11 Unique and Creative Writing Examples | AssignmentHelp4Me

Learn 11 Unique and Creative Writing Examples | AssignmentHelp4Me elp4Meelp4Me