Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Class list. public: list. -list int add (int 6 time stamp double & temperature,

ID: 3784489 • Letter: C

Question

Class list. public: list. -list int add (int 6 time stamp double & temperature, double windspeed) int display int displayTemp int displayWind int checkTime (int & timestamp) i int checkTemp (double & temperature) int checkwind (double & windspeed) private: int time; double temper double wind: struct node list, linked; node nexts; node nextT; next class datalogger public: datalogger -datalogger windspee int (int & timestamp double & temperature double 6 int print Report private: node heads: node head Ti headW: node tempHead;

Explanation / Answer

Answer

The setting of the multithreaded linked list is done pretty much the way you have done.

But the real challenge starts when you have to make insertion, deletion and other operation on the linked list as acquiring the proper locks gets more complicated.

In order to prevent deadlocks you'll need to acquire lock for the item that you want to operate on both before and after the operation and you will need to make sure that you do so in the same order always.