Identifying Code that Wastes Time Switching Tasks
First Claim
Patent Images
1. A method of detecting portions of code of a computer program that protect resources of a computer system unnecessarily, said method comprising:
- identifying a synchronization object that has been engaged by a thread of the computer program;
while the synchronization object is engaged, recording each access of a resource of the computer system that is protected by the synchronization object and a thread associated with the access;
when the synchronization object is disengaged, determining a number of threads that have accessed the resource while protected by the synchronization object during execution of the computer program; and
indicating whether the resource protected by the synchronization object is suited for protection according to the number of threads that accessed the resource while the synchronization object was engaged during execution of the computer program.
1 Assignment
0 Petitions
Accused Products
Abstract
A method of detecting portions of code of a computer program that protect resources of a computer system unnecessarily can include identifying threads and synchronization objects that are used by a computer program during execution, determining the number of threads that have accessed each resource while it has been consistently protected by a particular synchronization object, and indicating whether the resource is suited for protection according to the number of threads that have accessed the resource.
40 Citations
20 Claims
-
1. A method of detecting portions of code of a computer program that protect resources of a computer system unnecessarily, said method comprising:
-
identifying a synchronization object that has been engaged by a thread of the computer program;
while the synchronization object is engaged, recording each access of a resource of the computer system that is protected by the synchronization object and a thread associated with the access;
when the synchronization object is disengaged, determining a number of threads that have accessed the resource while protected by the synchronization object during execution of the computer program; and
indicating whether the resource protected by the synchronization object is suited for protection according to the number of threads that accessed the resource while the synchronization object was engaged during execution of the computer program. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A method of detecting portions of code of a multithreaded computer program that cause unnecessary task switching within a computer system comprising:
-
identifying resources protected by synchronization objects during execution of the multithreaded computer program;
counting instances during execution of the multithreaded computer program in which a resource that is protected by a synchronization object is accessed by only a single thread that engaged the synchronization object; and
indicating that resources accessed by only the single thread that engaged the synchronization object during execution of the multithreaded program are unsuitable for protection by a synchronization object. - View Dependent Claims (10, 11, 12, 13, 14)
-
-
15. A machine readable storage, having stored thereon a computer program having a plurality of code sections comprising:
-
code for identifying resources protected by synchronization objects during execution of the multithreaded computer program;
code for counting instances during execution of the multithreaded computer program in which a resource that is protected by a synchronization object is accessed by only a single thread that engaged the synchronization object; and
code for indicating that resources accessed by only the single thread that engaged the synchronization object during execution of the multithreaded program are unsuitable for protection by a synchronization object. - View Dependent Claims (16, 17, 19, 20)
-
-
18. The machine readable storage of claim 18, said code for identifying further comprising code for, for each access of a memory block, setting at least one bit corresponding to the thread responsible for the access and the synchronization object engaged during the access.
Specification