✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
Simulate a smart home system. Sensors send sensor events to a central hub. Each sensor event has a timestamp, severity, type and location. Notification worker threads consume events from the central hub. If the sensor event severity is low the event is logged (written on disk), if the severity is high the notification worker raises an alarm ( prints in the error console). In main test the program with 5 sensors and 3 workers. Solve the concurrent access to shared resources using synchronization, wait and notify or explicit locks. Sensors should continuously produce random events.
Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!