Digital Assignment 2 Due Date 18-10-21
Digital Assignment 2 Due Date 18-10-21
FALL 2021-2022
ETH (SLOT-A1+TA1)
Q3. Multithreading
Five events E1, E2, E3, E4 and E5 are going to be organized for Gravitas in VIT,
registration is open for all B.Tech students. With the total strength of 1000
students, simulate the registration for each event by generating 1000 random
numbers in the range of 1 – 5. (1 for event E1, 2 for E2… 5 for E5) and store the
values in an array. Create six threads to equally share the task of counting the
number of registration details for all the events. Use synchronized method or
synchronized block to update the count variables. The main thread should receive
the final registration count for all events and display the list of students who have
not registered in any event.
Submission:
i) You must submit:
(a) A short report (in PDF or word), which should be uploaded to the VTOP, as a
single file. For programs, provide the source code and output in your report.
Similarity of your report, will be checked. If the answers are unique, then the
maximum marks will be given others will get less marks.
(b) Any submission after the deadline (18-09-2021) will not be considered for
evaluation of marks.