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, determining whether state memory has been allocated for a resource of the computer system that is protected by the synchronization object and, if state memory has not been allocated, allocating state memory for recording accesses to the resource;
recording each access of the resource 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.
-
Citations
17 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, determining whether state memory has been allocated for a resource of the computer system that is protected by the synchronization object and, if state memory has not been allocated, allocating state memory for recording accesses to the resource; recording each access of the resource 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 (4, 5, 6, 7)
-
- 2. The method of 1, said allocating step further comprising apportioning a number of state bits determined according to a number of synchronization objects that have been engaged in the computer program, a number of threads running in the computer program, and a measure of a size of the resource.
-
8. 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; for each resource that is accessed while a synchronization object is engaged for the resource, determining whether state memory has been allocated; if state memory has not been allocated, allocating state memory for recording accesses to the resource; 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 (9, 10, 11, 12)
-
-
13. 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, for each resource that is accessed while a synchronization object is engaged for the resource, determining whether state memory has been allocated; code for, if state memory has not been allocated, allocating state memory for recording accesses to the resource; 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 (14, 15, 16, 17)
-
Specification