Download Sun Studio 12: Thread Analyzer User's Guide
Transcript
3.4 Understanding the Experiment Results Lock being Thread #5 Lock being Lock being Thread #6 Lock being Lock being requested: 0x215f0, at: grab_chopstick + 0x0000002C, line 101 in "din_philo.c" held: 0x215f0, at: grab_chopstick + 0x0000002C, line 101 in "din_philo.c" requested: 0x21608, at: grab_chopstick + 0x0000002C, line 101 in "din_philo.c" held: 0x21608, at: grab_chopstick + 0x0000002C, line 101 in "din_philo.c" requested: 0x215a8, at: grab_chopstick + 0x0000002C, line 101 in "din_philo.c" Deadlocks List Summary: Experiment: tha.1.er Total Deadlocks: 2 (er_print) The following screen-shot shows the Thread Analyzer's presentation of the deadlock information: The Thread Analyzer reports two deadlocks for din_philo.c, one potential and the other actual. On closer inspection, we find that the two deadlocks are identical. The circular chain involved in the deadlock is as follows: Thread 2: holds lock at address 0x215a8, requests lock at address 0x215c0 Thread 3: holds lock at address 0x215c0, requests lock at address 0x215d8 Thread 4: holds lock at address 0x215d8, requests lock at address 0x215f0 Thread 5: holds lock at address 0x215f0, requests lock at address 0x21608 Thread 6: holds lock at address 0x21608, requests lock at address 0x215a8 Select the first thread in the chain (Thread #2) and then click on the Dual Source tab to see where in the source code Thread #2 held the lock at address 0x215a8, and where in the source code it requested the lock at address 0x215c0. The following screen-shot shows the Dual Source tab for thread number two. The default metric (Exclusive Deadlocks metric) is shown to the left Chapter 3 • The Deadlock Tutorial 51