

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A lab exercise focused on working with java threads, specifically creating a producer and consumer thread for generating and consuming student objects. The exercise is repeated in two situations: non-synchronized and synchronized. The results are displayed on a jtextarea attached to a jinternalframe.
Typology: Lab Reports
1 / 3
This page cannot be seen from the preview
Don't miss anything!
In this lab we are going to work with Threads. The Lab consists of generating a producer thread and one or more consumer threads. The code is again an extension of your previous labs code thus expanding on the GUI. Your producer thread is a thread that produces a student object with a particular id (including the other attributes as in previous labs). The object is stored in a shared memory location and then it can be consumed by a School thread. The lab will be repeated for two different situations. In one situation the threads are non synchronized and in the second situation the threads are synchronized. In both case the data should be displayed on a JText Area attached to a JInternalFrame. In the Pre-Lab do the following:
Create the following event handlers for the menu items created in the Pre-Lab section: