IP Library Granted Patent US 7,395,530
Granted Patent B2
US 7,395,530 · App. 10/930,032 · Granted Jul 1, 2008

Method for implementing single threaded optimizations in a potentially multi-threaded environment

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,395,530
App. No.
10/930,032
Granted
Jul 1, 2008
Kind
B2
Abstract

Under the present invention, program code is examined (statically or dynamically) for characteristics indicative of a potential to generate multiple threads. If none are found, single threaded optimization(s) such as desynchronization, optimization of globals, etc., can be implemented. In addition, if the program code is later revealed to have the potential to generate multiple threads, the single threaded optimization(s) can be corrected to avoid incorrect execution.

Claims (15)

1. A method for implementing single threaded optimizations in a potentially multi-threaded environment, comprising:

examining program code for characteristics indicative of a potential to generate multiple threads; wherein the examining is performed dynamically as the program code is running allowing the method to be refined; wherein the method is refined by at least one of reducing a number of situations that prevent single threaded optimizations from being implemented and delaying correction of single threaded optimizations that have been implemented; and

implementing at least one single threaded optimization if the examining reveals that the program code does not have the potential to generate multiple threads, wherein the implementing is correctible if the program code is later revealed to have the potential to generate multiple threads.

2. The method of claim 1 , wherein the examining is performed statically before the program is run.

3. The method of claim 1 , wherein the examining comprises examining the program code for a thread creation primitive.

4. The method of claim 1 , wherein the examining comprises examining a finalizer method in each class that is loaded by the program code for the potential to generate multiple threads.

5. The method of claim 1 , wherein the examining comprises examining whether a native thread created by any process of the program code is attached to a JAVA process.

6. The method of claim 1 , wherein the implementing comprises desynchronizing the program code if the examining reveals that the program code does not have the potential to generate multiple threads.

7. The method of claim 1 , wherein the implementing comprises at least one of:

optimizing globals for the program code if the examining reveals that the program code does not have the potential to generate multiple threads; and

removing the at least one single threaded optimization if the examining is erroneous.

8. A method for implementing single threaded optimizations in a potentially multi-threaded environment, comprising:

dynamically examining program code for characteristics indicative of a potential to generate multiple threads; wherein performing the examining dynamically allows the method to be refined; wherein the method is refined by at least one of reducing a number of situations that prevent single threaded optimizations from being implemented and delaying correction of single threaded optimizations that have been implemented;

implementing at least one single threaded optimization if the dynamically examining step reveals that the program code does not have the potential to generate multiple threads; and

removing the at least one single threaded optimization if the program code is later revealed to have the potential to generate multiple threads.

Assignments (3)
CHANGE OF NAME Recorded Dec 20, 2021
From: FACEBOOK, INC.
To: META PLATFORMS, INC.
Reel/Frame 058553/0802 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 4, 2012
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: FACEBOOK, INC.
Reel/Frame 027991/0473 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 17, 2004
From: INGLIS, DEREK B.; GRAY-DONALD, TRENT A.; STOODLEY, KEVIN A.; SUNDARESAN, VIJAY
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 015145/0240 →