Patent ID: 8893134

Claim:
A computer program product for locating a bottleneck in a multi-threaded application, the computer program product comprising: a computer readable storage medium having computer readable program code embodied therewith, the computer readable program code configured to: obtain synchronization event data acquired from capturing synchronization events by a data collection component at run-time, wherein a synchronization event occurs when a thread of the multi-threaded application, comprising a plurality of application threads, attempts to obtain a shared resource; identify a consumer-producer communication pattern from the synchronization event data, wherein the identifying of the consumer-producer communication pattern includes: identifying a producer thread of the plurality of application threads that produces a particular set of data from the synchronization event data, the producer thread calls a producer method to access the shared resource, and identifying a consumer thread of the plurality of application threads that requires as input, the particular set of data produced by the producer thread from the synchronization event data, the consumer thread calls a consumer method to access the shared resource, wherein the consumer method is not the same as the producer method; identify a rate at which the producer thread produces the particular set of data; and identify a rate at which the consumer thread consumes the particular set of data; determine that the consumer-producer communication pattern is a bottleneck when the identified rate at which the consumer thread consumes the particular set of data exceeds the identified rate at which the producer thread produces the particular data; and eliminate the bottleneck by increasing a size of a synchronized queue shared by threads of the multi-threaded application and changing an implementation of a data structure used by consumers and producers to communicate.