Method and apparatus for performing dynamic optimization for software transactional memory
Claim Score by NHIP
Abstract
A method for managing a transaction includes determining that an optimistically immutable field in the transaction is written to. Invaliding a method in response to determining that the method in the transaction reads is the optimistically immutable field. Other embodiments are disclosed and claimed.

Term
Projected expiry 15 December 2029.
- Priority and filed
- Published
- Today
- Projected expiry
20 claims: 4 independent, 16 dependent
- 1Broadest claimClaim Score 95, very broad(NHIP)A method for managing a transaction, comprising:determining that an optimistically immutable field in the transaction is written to;determining that a method in the transaction reads the optimistically immutable field;and invalidating the method.
- 11An article of manufacture comprising a machine accessible medium including sequences of instructions, the sequences of instructions including instructions which when executed cause the machine to perform:determining that an optimistically immutable field in the transaction is written to;determining that a method in the transaction reads the optimistically immutable field;and invalidating the method.
- 14A main engine, comprising:a transaction execution unit to compare a version number of a virtual table accessed during execution of instructions in a transaction with the version number of the virtual table after execution of the instructions in the transaction and undo the instructions upon determining that the version number has changed.
- 19A just-in-time compiler, comprising:a transaction monitor unit having a field write monitor to generate a call indicating that an optimistically immutable field is written to by an instruction in a transaction.
Independent claims4
71 paragraphs in 4 sections, as filed
FIELD
0001An embodiment of the present invention pertains to software transactional memory (STM). More specifically, an embodiment of the present invention relates to a method and apparatus for performing dynamic optimization for STM.
BACKGROUND
0002STM is a concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing. It functions as an alternative to lock-based synchronization, and is typically implemented in a lock-free way. A transaction in this context is a piece of code that executes a series of reads and writes to shared memory. These reads and writes logically occur at a single instant in time. Immediate states are not visible to other transactions.
0003STM may use read barriers to mediate access to shared memory locations such as object fields and class fields. The read barriers allow STM to detect when fields are read in a transaction while being written to in another transaction. Read barriers involve execution of additional instructions which can adversely impact the performance of a program.
0004Attempts to improve STM techniques in the past involved performing immutable field optimization. Immutable fields are fields that are not modified once an object has been initialized. Fields may refer to object field or static (class) fields. An STM system can improve performance significantly by avoiding the overheads of utilizing read barriers on accesses to immutable fields.
0005Immutable field optimization, however, rely on explicit “final” annotations by a programmer or knowledge of which standard classes are immutable. Many other fields are implicitly final because they are never updated after object initialization. While a compiler can be configured to detect such fields through whole program analysis, languages that allow dynamic class loading, such as Java, make whole program analysis infeasible.
BRIEF DESCRIPTION OF THE DRAWINGS
0006The features and advantages of embodiments of the present invention are illustrated by way of example and are not intended to limit the scope of the embodiments of the present invention to the particular embodiments shown.
0007<figref idref="DRAWINGS">FIG. 1</figref> is a block diagram of a software compilation and execution system according to an exemplary embodiment of the present invention.
0008<figref idref="DRAWINGS">FIG. 2</figref> is a block diagram of a hardware platform according to an exemplary embodiment of the present invention.
0009<figref idref="DRAWINGS">FIG. 3</figref> is a block diagram of a virtual machine according to an exemplary embodiment of the present invention.
0010<figref idref="DRAWINGS">FIG. 4</figref> is a block diagram of a just-in-time compiler according to an exemplary embodiment of the present invention.
0011<figref idref="DRAWINGS">FIG. 5</figref> is a block diagram of a transaction optimization unit according to an exemplary embodiment of the present invention.
0012<figref idref="DRAWINGS">FIG. 6</figref> is a flow chart illustrating a method for managing a field write according to an exemplary embodiment of the present invention.
0013<figref idref="DRAWINGS">FIG. 7</figref> is a flow chart illustrating a method for managing a read by a method according to an exemplary embodiment of the present invention.
0014<figref idref="DRAWINGS">FIG. 8</figref> is a flow chart illustrating a method for invalidating a method according to an exemplary embodiment of the present invention.
0015<figref idref="DRAWINGS">FIG. 9</figref> is a flow chart illustrating a method for managing a method dispatch barrier according to an exemplary embodiment of the present invention.
DETAILED DESCRIPTION
0016<figref idref="DRAWINGS">FIG. 1</figref> illustrates a software program compilation and execution system <b>100</b> according to an embodiment of the present invention. The software program compilation and execution system <b>100</b> includes a compiler <b>120</b> that compiles source code <b>110</b> into an intermediate language code <b>130</b>. The source code <b>110</b> may be, for example, Java. The intermediate language code <b>130</b> may be, for example, Java byte-code or Common Intermediate Language code. According to an embodiment of the present invention, the compiler <b>120</b> is a software system that is run on a computer system and the intermediate language code <b>130</b> is stored in a memory of the computer system, a hard drive, or downloaded from an external source.
0017The software program compilation and execution system <b>100</b> includes a virtual machine <b>140</b> and a hardware platform <b>150</b>. The virtual machine <b>140</b> further compiles the intermediate language code <b>130</b> into native code. According to an embodiment of the present invention, native code is machine code that is particular to a specific architecture or platform. The virtual machine <b>140</b> may be implemented as a software system. In this embodiment, the virtual machine <b>140</b> runs on the hardware platform <b>150</b>. The virtual machine <b>140</b> may be, for example, a Java virtual machine, a small talk runtime system, or other runtime system. Alternatively, the virtual machine <b>140</b> may be implemented using other techniques (e.g., as a firmware system).
0018The hardware platform <b>150</b> executes the native code compiled by the virtual machine <b>140</b>. The hardware platform <b>150</b> may be implemented, for example, by a personal computer, a personal digital assistant, a network computer, a server computer, a notebook computer, a workstation, a mainframe computer, or a supercomputer. Alternatively, the hardware platform <b>150</b> may be implemented by any other electronic system with data processing capabilities. The intermediate language code <b>130</b> may be delivered to the hardware platform <b>150</b> via a communication link such as a local area network, the Internet, or a wireless communication network.
0019<figref idref="DRAWINGS">FIG. 2</figref> is a block diagram of an exemplary computer system <b>200</b> according to an embodiment of the present invention. The computer system <b>200</b> may be used to implement the hardware platform <b>150</b> shown in <figref idref="DRAWINGS">FIG. 1</figref>. The computer system <b>200</b> includes a processor <b>201</b> that processes data signals. The processor <b>201</b> may be a complex instruction set computer microprocessor, a reduced instruction set computing microprocessor, a very long instruction word microprocessor, a processor implementing a combination of instruction sets, or other processor device. <figref idref="DRAWINGS">FIG. 2</figref> shows the computer system <b>200</b> with a single processor. However, it is understood that the computer system <b>200</b> may operate with multiple processors. The processor <b>201</b> is coupled to a CPU bus <b>210</b> that transmits data signals between processor <b>201</b> and other components in the computer system <b>200</b>. According to an embodiment of the present invention, the processor <b>201</b> may implement thread-level-parallelism to increase utilization of processor execution resources. By utilizing simultaneous multi-threading technology, multiple threads of software applications may be run simultaneously on the processor <b>201</b>.
0020The computer system <b>200</b> includes a memory <b>213</b>. The memory <b>213</b> may be a dynamic random access memory device, a static random access memory device, read only memory, and/or other memory device. The memory <b>213</b> may store instructions and code represented by data signals that may be executed by the processor <b>201</b>. A cache memory <b>202</b> resides inside processor <b>201</b> that stores data signals stored in memory <b>213</b>. The cache <b>202</b> speeds up memory accesses by the processor <b>201</b> by taking advantage of its locality of access. In an alternate embodiment of the computer system <b>200</b>, the cache <b>202</b> resides external to the processor <b>201</b>. The processor <b>201</b> may use a store buffer (not shown) to hold data to be written into the cache memory <b>202</b> in preparation for depositing it into memory <b>213</b>.
0021A bridge memory controller <b>211</b> is coupled to the CPU bus <b>210</b> and the memory <b>213</b>. The bridge memory controller <b>211</b> directs data signals between the processor <b>201</b>, the memory <b>213</b>, and other components in the computer system <b>200</b> and bridges the data signals between the CPU bus <b>210</b>, the memory <b>213</b>, and a first input output (IO) bus <b>220</b>.
0022The first IO bus <b>220</b> may be a single bus or a combination of multiple buses. The first IO bus <b>220</b> provides communication links between components in the computer system <b>200</b>. A network controller <b>221</b> is coupled to the first IO bus <b>220</b>. The network controller <b>221</b> may link the computer system <b>200</b> to a network of computers (not shown) and supports communication among the machines. A display device controller <b>222</b> is coupled to the first IO bus <b>220</b>. The display device controller <b>222</b> allows coupling of a display device (not shown) to the computer system <b>200</b> and acts as an interface between the display device and the computer system <b>100</b>.
0023A second IO bus <b>230</b> may be a single bus or a combination of multiple buses. The second IO bus <b>230</b> provides communication links between components in the computer system <b>200</b>. A data storage device <b>231</b> is coupled to the second IO bus <b>230</b>. The data storage device <b>231</b> may be a hard disk drive, a floppy disk drive, a CD-ROM device, a flash memory device or other mass storage device. An input interface <b>232</b> is coupled to the second IO bus <b>230</b>. The input interface <b>232</b> may be, for example, a keyboard and/or mouse controller or other input interface. The input interface <b>232</b> may be a dedicated device or can reside in another device such as a bus controller or other controller. The input interface <b>232</b> allows coupling of an input device to the computer system <b>200</b> and transmits data signals from an input device to the computer system <b>200</b>. A bus bridge <b>223</b> couples the first IO bus <b>220</b> to the second IO bus <b>230</b>. The bus bridge <b>223</b> operates to buffer and bridge data signals between the first IO bus <b>220</b> and the second IO bus <b>230</b>.
0024<figref idref="DRAWINGS">FIG. 3</figref> is a block diagram of a virtual machine <b>300</b> according to an embodiment of the present invention. The virtual machine <b>300</b> maybe implemented as the virtual machine <b>140</b> shown in <figref idref="DRAWINGS">FIG. 1</figref>. The virtual machine <b>300</b> includes a main engine <b>310</b>. The main engine <b>310</b> may be employed as the main core of the virtual machine <b>300</b>. The main engine <b>310</b> monitors compilation and execution of the intermediate language code, and coordinates use of other modules in the virtual machine <b>300</b> when required. The main engine <b>310</b> also supports software transaction memory to allow instructions in a transaction to be seen logically as executing in the same instance of time.
0025According to an embodiment of the virtual machine <b>300</b>, the main engine includes a transaction optimization (TO) unit <b>311</b>. The transaction optimization unit <b>311</b> keeps track of the status of object and class fields in a transaction. According to one embodiment, the transaction optimization unit <b>311</b> keeps track of whether each field is optimistically immutable. A field may be optimistically immutable if the virtual machine <b>300</b> believes that the field is immutable based upon the processed byte code. The optimization unit <b>311</b> also keeps track of methods that read fields that are optimistically immutable. The transaction optimization unit <b>311</b> invalidates methods corresponding to an optimistically immutable field in response to determining that the field has been written to and is therefore not immutable.
0026The virtual machine <b>300</b> includes a class loader <b>320</b>. The class loader <b>320</b> may be used to load classes. The class loader <b>320</b> may also perform other functions associated with loading classes. For example, the class loader <b>320</b> may also verify loaded classes.
0027The virtual machine <b>300</b> includes class libraries <b>330</b>. The class libraries <b>330</b> may be used to store shared classes when a program may include more than one type of class, (i.e., application-specific class and shared class).
0028The virtual machine <b>300</b> includes a just-in-time compiler <b>340</b>. The just-in-time compiler <b>340</b> may compile intermediate language code to generate native or machine code at runtime that is executed by a hardware According to an embodiment of the present invention, “just-in-time” refers to the just-in-time compiler <b>340</b> compiling or translating each method or class when it is used for execution into native code. The just-in-time compiler <b>340</b> may also store some compiled native code in a just-in-time in-memory cache (not shown in <figref idref="DRAWINGS">FIG. 3</figref>). In this manner, the virtual machine <b>300</b> may re-use native code associated with a previously compiled method or object that is invoked or called more than once. According to an embodiment of the virtual machine <b>300</b>, the just-in-time compiler <b>340</b> determines when an optimistically immutable field is written to by an instruction in a transaction and generates a notification to the transaction optimization unit <b>311</b>. The just-in-time compiler <b>340</b> also determines when an optimistically immutable field is read by a method in the transaction and generates a notification to the transaction optimization unit <b>311</b>.
0029The virtual machine <b>300</b> includes a memory manager <b>350</b>. The memory manager <b>350</b> may be used to manage a specific memory space within the memory referred to as heap or heap space. The memory manager <b>350</b> includes a heap allocation module <b>351</b> and a garbage collector <b>353</b>. The heap allocation module <b>351</b> is used to allocate objects from the heap space in the memory. The garbage collector <b>353</b> is used to reclaim memory space in the heap used by objects that are no longer referenced by an application or method. Additionally, the garbage collector <b>353</b> also may move objects to reduce heap fragmentation. The memory manager <b>350</b> interacts with the main engine <b>310</b> and the just-in-time compiler <b>340</b>.
0030The main engine <b>310</b>, class loader <b>320</b>, class libraries <b>330</b>, just-in-time compiler <b>340</b>, and memory manager <b>350</b> may be implemented using any known technique or circuitry. It should be appreciated that other components may also be implemented in the virtual machine <b>300</b>. The transaction optimization unit <b>311</b> is shown to reside inside the main engine <b>310</b>. It should also be appreciated that the transaction optimization unit <b>311</b> may reside elsewhere in the virtual machine <b>300</b> outside the main engine <b>310</b>.
0031<figref idref="DRAWINGS">FIG. 4</figref> is a block diagram of a just-in-time compiler <b>400</b> according to an embodiment of the present invention. The just-in-time compiler <b>400</b> may be used to implement the just-in-time compiler <b>340</b> shown in <figref idref="DRAWINGS">FIG. 3</figref>. The just-in-time compiler <b>400</b> includes a compiler manager <b>410</b>. The compiler manager <b>410</b> receives intermediate language code, such as Java byte-code or Common Intermediate Language code, to compile. The compiler manager <b>410</b> interfaces with and transmits information between other components in the just-in-time compiler <b>400</b>.
0032The just-in-time compiler <b>400</b> includes a front end unit <b>420</b>. According to an embodiment of the just-in-time compiler <b>400</b>, the front end unit <b>420</b> operates to parse the intermediate language code and to convert it to an abstract syntax tree.
0033The just-in-time compiler <b>400</b> includes an optimizer unit <b>430</b>. The optimizer unit <b>430</b> may utilize one or more optimization procedures to optimize the intermediate language code. According to an embodiment of the just-in-time compiler <b>400</b>, the optimizer unit <b>430</b> may perform peephole, local, loop, global, interprocedural and/or other optimizations.
0034The just-in-time compiler <b>400</b> includes a code generator unit <b>440</b>. The code generator unit <b>440</b> converts the intermediate representation into machine or assembly code that is native to a local processor.
0035The just-in-time compiler <b>400</b> includes a transaction monitor (TM) unit <b>450</b>. The transaction monitor unit <b>450</b> includes a field write monitor (FWM) <b>451</b>. The field write monitor <b>451</b> identifies writes to a field in a transaction. Upon determining that the field is optimistically immutable, the field write monitor <b>451</b> generates a notification that code in the transaction writes to the field. The transaction monitor unit <b>450</b> also includes a field read monitor. The field read monitor (FRM) <b>452</b> identifies reads of a field in a transaction. Upon determining that the field is optimistically immutable, the field read monitor <b>452</b> generates a notification that a compiled method reads this optimistic immutable field in a transaction.
0036The just-in-time compiler <b>400</b> is shown to be implemented with a compiler manager <b>410</b>, front end unit <b>420</b>, optimizer unit <b>430</b>, code generation unit <b>440</b>, and transaction monitor unit <b>450</b>. It should be appreciated that the just-in-time compiler <b>400</b> may be implemented with a subset of the components described with reference to <figref idref="DRAWINGS">FIG. 4</figref>. It should also be appreciated that other components may reside in the just-in-time compiler <b>400</b>.
0037<figref idref="DRAWINGS">FIG. 5</figref> is a block diagram of a transaction optimization unit <b>500</b> according to an exemplary embodiment of the present invention. The transaction optimization unit <b>500</b> may be used to implement the transaction optimization unit <b>311</b> shown in <figref idref="DRAWINGS">FIG. 3</figref>. The transaction optimization unit <b>500</b> includes a transaction optimization unit manager <b>510</b>. The transaction optimization unit manager <b>510</b> is coupled to and transmits information between components in the transaction optimization unit <b>500</b>.
0038The transaction optimization unit <b>500</b> includes a field status unit <b>520</b>. The field status unit <b>520</b> maintains a list of optimistically immutable fields. According to an embodiment of the transaction optimization unit <b>500</b>, all fields may be initially assumed to be optimistically immutable. Alternatively, a field may be determined to be optimistically immutable after one or more methods are inspected to confirm that there are no instructions to write to the field. The field status unit <b>520</b> may for example implement a method, is FieldOptimistic(F), that returns true if field F is optimistically immutable and false otherwise. The field status unit <b>520</b> may implement this method to check if its list of optimistically immutable fields contains field F. It should be appreciate that other data structures may be implemented to track the status of a field. For example, instead of maintaining a list of immutable fields, status field unit <b>520</b> may maintain a per-field flag to indicate whether a field is currently optimistically immutable. The field status unit <b>520</b> updates its list of optimistically immutable fields upon receiving a notification from a just-in-time compiler that a particular field has been written. The notification may be in the form of a call, such as for example, fieldWritten(F), supported by an API function.
0039The transaction optimization unit <b>500</b> includes a method status unit <b>530</b>. The method status unit <b>530</b> maintains lists of methods that read optimistically immutable fields. For example, each field, F, may have a corresponding list of methods, OptimisticMethods(F), that read from optimistically immutable field F. The method status unit <b>530</b> updates its list of methods upon receiving notification from a just-in-time compiler that a particular method is reading an optimistically immutable field. The notification may be in the form of a call, such as for example, fieldOptimisticallyRead(F). The method status unit <b>530</b> may delete a list of methods corresponding to an optimistically immutable field upon determining that the field has been written to and is no longer optimistically immutable.
0040The transaction optimization unit <b>500</b> includes an invalidation unit <b>540</b>. The invalidation unit <b>540</b> manages a virtual method table that includes pointers to a location in memory where compiled code for a method resides or that includes a compilation stub (an instruction or a pointer to an instruction to compile code.) The invalidation unit <b>540</b> invalidates a method in response to determining that an optimistically immutable field F has been written to. According to an embodiment of the transaction optimization unit <b>500</b>, the invalidation unit <b>540</b>, identifies one or more methods that read the optimistically immutable field that has been written to and indicates on a virtual table that the method is to be re-compiled. In one embodiment, re-compiling involves compiling the method with a read barrier. According to an embodiment of the present invention, the invalidation unit <b>540</b> does this by replacing a virtual table entry corresponding to the method with a compilation stub. Next, invocation of the method will result in execution of the compilation stub and recompilation of the method. The recompiled method may include a read barrier for reads of field F because that filed is no longer optimistically immutable. The invalidation unit <b>540</b> may lock the virtual method table while it is writing to it and write a new version number for the virtual method table after removing the lock.
0041The transaction optimization unit <b>500</b> is shown to be implemented with a transaction optimization unit manager <b>510</b>, field status unit <b>520</b>, method status unit <b>530</b>, and an invalidation unit <b>540</b>. It should be appreciated that the transaction optimization unit <b>500</b> may be implemented with a subset of the components illustrated in <figref idref="DRAWINGS">FIG. 5</figref>. It should also be appreciated that other components may reside in the transaction optimization unit <b>500</b>.
0042According to an embodiment of the present invention, a just-in-time compiler detects fields that are implicitly final in the presence of dynamic loading. The just-in-time compiler makes optimistic assumption about fields based on its current, incomplete view of compiled code. A transaction optimization unit invalidates those assumptions if new code is compiled that writes to a field that the just-in-time compiler assumed was immutable. The transaction optimization unit invalidates code generated based on the invalid assumptions, which causes threads that may be executing such code to abort.
0043Referring back to <figref idref="DRAWINGS">FIG. 3</figref>, the main engine <b>310</b> includes a transaction execution (TE) unit <b>312</b>. The transaction execution unit <b>312</b> compares a version number of a virtual table accessed during execution of instructions in a transaction with the version number of a virtual table after execution of the instruction sin the transaction. The transaction execution unit <b>312</b> undoes the instructions in the transaction upon determining that the version number has changed. It should be appreciated that the transaction execution unit <b>312</b> may be implemented in other components of the virtual machine <b>300</b>.
0044According to an embodiment of the present invention, STM guarantees that transactions execute if they were executing sequentially. An STM keeps track of reads and writes performed by a transaction. If the STM detects that two transactions are in conflict (the transactions access the same memory location and one of the accesses is a write), the STM aborts one of the two transactions. In one embodiment; each memory location is associated with a transaction record. The transaction record may include either a version number or an identifier of the tread that owns the transaction record. When a transaction reads data, it records the version number. When a transaction writes data, it acquires ownership of the transaction record. Before committing, a transaction checks if all the data that it read still has the same version number. This procedure is referred to as validation. If the version numbers of all data read is the same, the transaction is committed and ownership of all the data written is released by setting corresponding transaction records to the next version number. If the version numbers of all the data is not the same, the transaction aborts.
0045<figref idref="DRAWINGS">FIG. 6</figref> is a flow chart illustrating a method for managing a field read according to an exemplary embodiment of the present invention. At <b>601</b>, a determination is made as to whether a write has been made to a field. The determination may be made, for example, by detecting a putfield or putstatic bytecode inside a transaction. According to one embodiment, writes inside constructors are considered outside of a transaction since the object is thread local while being constructed and thus is not considered as a write to the field. The determination may be made by a just-in-time compiler during compilation of intermediate language code. If it is determined that a write has been made to a field, control proceeds to <b>602</b>. If it is determined that a write has not been made to a field, control returns to <b>601</b>.
0046At <b>602</b>, it is determined whether the field is optimistically immutable. According to an embodiment of the present invention, the determination may be made by having a just-in-time compiler query a field status unit in the transaction optimization unit. The just-in-time compiler may use an API function such as is FieldOptimistic(F) to determine whether the field written to is optimistically immutable. If the field is not optimistically immutable, control proceeds to <b>603</b>. If the field is optimistically immutable, control proceeds to <b>604</b>.
0047At <b>603</b>, control terminates the process.
0048At <b>604</b>, a notification is generated to indicate that an optimistically immutable field is written to. According to an embodiment of the present invention, a just-in-time compiler may utilize an API call such as fieldWritten(F) to signal to a transaction optimization unit that the optimistically immutable field has been written to and is thus no longer optimistically immutable.
0049At <b>605</b>, a list of optimistically immutable fields is updated. According to an embodiment of the present invention, a field status unit in a transaction optimization unit may update the list of optimistically immutable field in response to the notification generated at <b>604</b>.
0050At <b>606</b>, the methods that read the optimistically immutable field are invalidated.
0051<figref idref="DRAWINGS">FIG. 7</figref> is a flow chart illustrating a method for managing a read in a method according to an exemplary embodiment of the present invention. At <b>701</b>, a determination is made as to whether a read has been made to a field by a method. The determination may be made by a just-in-time compiler during compilation of intermediate language code. If it is determined that a read has been made to a field, control proceeds to <b>702</b>. If it is determined that a read has not been made to a field, control returns to <b>701</b>.
0052At <b>702</b>, it is determined whether the field is optimistically immutable. According to an embodiment of the present invention, the determination may be made by having a just-in-time compiler query a field status unit in the transaction optimization unit. The just-in-time compiler may use an API function such as is FieldOptimistic(F) to determine whether the field written to is optimistically immutable. If the field is not optimistically immutable, control proceeds to <b>703</b>. If the field is optimistically immutable, control proceeds to <b>704</b>.
0053At <b>703</b>, control terminates the process.
0054At <b>704</b>, a notification is generated to indicate that an optimistically immutable field is read by the method. According to an embodiment of the present invention, ajust-in-time compiler may utilize an API call such as fieldOptimisticallyRead(F) to signal to an transaction optimization unit that the optimistically immutable field has been read from.
0055At <b>705</b>, a list of methods that read the optimistically immutable field is updated. According to an embodiment of the present invention, for each optimistically immutable field F, a set of compiled methods, OptimisticMethods(F), that read F inside a transaction is maintained. A method status unit in a transaction optimization unit may update the list of methods in response to the notification generated at <b>704</b>.
0056<figref idref="DRAWINGS">FIG. 8</figref> is a flow chart illustrating a method for invalidating a method according to an exemplary embodiment of the present invention. The procedure described in <figref idref="DRAWINGS">FIG. 8</figref> may be used to implement <b>606</b> in <figref idref="DRAWINGS">FIG. 6</figref>. At <b>801</b>, it is determined whether there has been a write to an optimistically immutable field. If it is determined that there has been a write to an optimistically immutable field, control proceeds to <b>802</b>. If it is determined that there has not been a write to an optimistically immutable field, control returns to <b>801</b>.
0057At <b>802</b>, it is determined whether there are any methods that read the optimistically immutable field. According to an embodiment of the present invention, for each optimistically immutable field F, a set of compiled methods, OptimisticMethods(F), that read F inside a transaction is maintained. The determination at <b>802</b> may be made by identifying whether there are any methods in OptimisticMethods(F). If it is determined that there is no method that reads the optimistically immutable field, control proceeds to <b>803</b>. If it is determined that a method reads the optimistically immutable field, control proceeds to <b>804</b>.
0058At <b>803</b>, control terminates the procedure.
0059At <b>804</b>, it is determined whether there are any additional virtual method tables (vtables) to update. Each virtual method table that includes an entry for a method that reads from the optimistically immutable field should be updated. If no additional virtual method tables need to be updated, control proceeds to <b>805</b>. If one or more additional virtual method tables need to be updated, control proceeds to <b>806</b> to update a virtual method table.
0060At <b>805</b>, the list of methods that read from the optimistically immutable field is deleted. According to an embodiment of the present invention, deletion occurs after virtual tables for all methods that read from the optimistically immutable field are re-written.
0061At <b>806</b>, a transaction record to a virtual method table that is being updated is locked. According to an embodiment of the present invention, a transaction record is associated with each virtual table. Locking the transaction record prevents the virtual method table to be accessed during the update.
0062At <b>807</b>, the entry corresponding to the method that reads from the optimistically immutable field is changed. According to an embodiment of the present invention, the entry is changed to indicate that the method is to be compiled with a read barrier.
0063At <b>808</b>, a version number of the virtual method table is updated after it is unlocked.
0064<figref idref="DRAWINGS">FIG. 9</figref> is a flow chart illustrating a method for managing a method dispatch barrier according to an exemplary embodiment of the present invention. At <b>901</b>, a version number for each virtual method table (vtable) accessed during execution of a transaction is identified while being read.
0065At <b>902</b>, the version number for each virtual method table accessed during execution of the transaction is identified after execution of the transaction is completed.
0066At <b>903</b>, it is determined whether the version number of any virtual method table changed after execution of the transaction. If no version number for a virtual method table is found to have changed, control proceeds to <b>904</b>. If a version number for a virtual method table is found to have changed, control proceeds to <b>905</b>.
0067At <b>904</b>, the instructions compiled are committed. It should be appreciated that compiled instructions may have other conflicts that cause the transaction to abort. In these situations, the instructions are not committed.
0068At <b>905</b>, all of the instructions in the transaction are undone. The instructions are to be re-compiled. According to an embodiment of the present invention, when the instructions are re-compiled, the instructions are re-compiled with new assumptions that allow the instructions to be re-compiled with read barriers.
0069<figref idref="DRAWINGS">FIGS. 6</figref>, <b>7</b>, <b>8</b> and <b>9</b> are flow charts illustrating methods according to exemplary embodiments of the present invention. Some of the techniques illustrated in these figures may be performed sequentially, in parallel or in an order other than that which is described. It should be appreciated that not all of the techniques described are required to be performed, that additional techniques may be added, and that some of the illustrated techniques may be substituted with other techniques.
0070Embodiments of the present invention may be provided as a computer program product, or software, that may include an article of manufacture on a machine accessible or machine readable medium having instructions. The instructions on the machine accessible or machine readable medium may be used to program a computer system or other electronic device. The machine-readable medium may include, but is not limited to, floppy diskettes, optical disks, CD-ROMs, and magneto-optical disks or other type of media/machine-readable medium suitable for storing or transmitting electronic instructions. The techniques described herein are not limited to any particular software configuration. They may find applicability in any computing or processing environment. The terms “machine accessible medium” or “machine readable medium” used herein shall include any medium that is capable of storing, encoding, or transmitting a sequence of instructions for execution by the machine and that cause the machine to perform any one of the methods described herein. Furthermore, it is common in the art to speak of software, in one form or another (e.g., program, procedure, process, application, module, unit, logic, and so on) as taking an action or causing a result. Such expressions are merely a shorthand way of stating that the execution of the software by a processing system causes the processor to perform an action to produce a result.
0071In the foregoing specification embodiments of the invention have been described with reference to specific exemplary embodiments thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the embodiments of the invention. For example, rather than keeping a transaction record for each virtual method table, a per-compiled method transaction record may be kept. In this embodiment, the prolog of an optimistically compiled method checks the transaction record and adds it to a read set. In another example, a virtual machine may keep a single global transaction record for all generated code. Each transaction read may check the single global transaction record and add it to a read set at the start of the transaction. The global transaction record is locked, incremented, and unlocked each time an optimistically compiled method M is invalided. All in-progress transactions are aborted regardless of whether they are called M. It should be appreciated that embodiments of the invention may be extended to support optimistically compiled transactional regions. Per-region transaction record may be kept and checked each time a region is executed. Compensation code is executed if a region is invalided. The embodiments of the invention may also be applied to class hierarchy analysis and to other optimistic optimization applications. The specification and drawings are, accordingly, to be regarded in an illustrative rather than restrictive sense.
Contents4
10 sheets
Sheet 1 Sheet 2 Sheet 3 Sheet 4 Sheet 5 Sheet 6 Sheet 7 Sheet 8 Sheet 9 Sheet 10
Every citation, both ways
| Document | Relation | Office | Cited during |
|---|---|---|---|
| US2011145498A1 | Cited by | United States of America | Pre-grant |
| US9195576B2 | Cited by | United States of America | Applicant |
| US8812796B2 | Cited by | United States of America | Applicant |
| US2010313079A1 | Cited by | United States of America | Pre-grant |
| US2010332771A1 | Cited by | United States of America | Pre-grant |
| US9946873B2 | Cited by | United States of America | Applicant |
| US8688951B2 | Cited by | United States of America | Applicant |
| US9658880B2 | Cited by | United States of America | Applicant |
| US9823939B2 | Cited by | United States of America | Applicant |
| US2007038981A1 | Cited by | United States of America | Pre-grant |
| US2010332768A1 | Cited by | United States of America | Pre-grant |
| WO2016014953A1 | Cited by | World Intellectual Property Organization (WIPO) | International search |
| US10268819B2 | Cited by | United States of America | Search report |
| US9424013B2 | Cited by | United States of America | Search report |
| US2010228929A1 | Cited by | United States of America | Pre-grant |
| US2011307669A1 | Cited by | United States of America | Pre-grant |
| US8417897B2 | Cited by | United States of America | Applicant |
| US9733909B2 | Cited by | United States of America | Applicant |
| US9880819B2 | Cited by | United States of America | Applicant |
| US8677329B2 | Cited by | United States of America | Applicant |
| US2007038980A1 | Cited by | United States of America | Pre-grant |
| US2010070954A1 | Cited by | United States of America | Pre-grant |
| US9767027B2 | Cited by | United States of America | Applicant |
| US2010313189A1 | Cited by | United States of America | Pre-grant |
| US9092253B2 | Cited by | United States of America | Search report |
| US7805712B2 | Cited by | United States of America | Search report |
| US2007055727A1 | Cited by | United States of America | Pre-grant |
| US8495601B2 | Cited by | United States of America | Search report |
| US11281481B2 | Cited by | United States of America | Applicant |
| US9117071B2 | Cited by | United States of America | Applicant |
| US8539472B2 | Cited by | United States of America | Applicant |
| US10353680B2 | Cited by | United States of America | Applicant |
| US2017316201A1 | Cited by | United States of America | Search report |
| US2017316201A1 | Cited by | United States of America | Pre-grant |
| US2010169870A1 | Cited by | United States of America | Pre-grant |
| US8631393B2 | Cited by | United States of America | Search report |
| US2002038301A1 | Cites | United States of America | Pre-grant |
| US2002104077A1 | Cites | United States of America | Pre-grant |
| US2004010664A1 | Cites | United States of America | Pre-grant |
| US2005262522A1 | Cites | United States of America | Pre-grant |
| US2006235837A1 | Cites | United States of America | Pre-grant |
| US2007169030A1 | Cites | United States of America | Pre-grant |
| US2007198979A1 | Cites | United States of America | Pre-grant |
| US2007240135A1 | Cites | United States of America | Pre-grant |
| US2008005112A1 | Cites | United States of America | Pre-grant |
| US5404525A | Cites | United States of America | Pre-grant |
| US5515536A | Cites | United States of America | Pre-grant |
| US5761670A | Cites | United States of America | Pre-grant |
| US6092097A | Cites | United States of America | Pre-grant |
| US6182282B1 | Cites | United States of America | Pre-grant |
| US6223340B1 | Cites | United States of America | Pre-grant |
| US6438560B1 | Cites | United States of America | Pre-grant |
| US6925638B1 | Cites | United States of America | Pre-grant |
| US7089272B1 | Cites | United States of America | Pre-grant |
2 priority claims, no other members on record
Priority claims2
| Document | Office | Kind | Date |
|---|---|---|---|
| 54081706 | United States of America | A | |
| US20060540817 | – | – | – |
32 transactions on the USPTO file
Allowed after 1 non-final rejection.
- Non-final rejections
- 1
- Final rejections
- 0
- RCEs
- 0
- Appeals
- 0
Over time
Point at a mark for the transactionTransactions
| Event | Code | |
|---|---|---|
| Recordation of Patent Grant MailedPGM/ | PGM/ | |
| Patent Issue Date Used in PTA CalculationAllowedPTAC | PTAC | |
| Issue Notification MailedAllowedWPIR | WPIR | |
| Dispatch to FDCD1935 | D1935 | |
| Dispatch to FDCD1935 | D1935 | |
| Application Is Considered Ready for IssuePILS | PILS | |
| Response to Reasons for AllowanceREAS | REAS | |
| Issue Fee Payment VerifiedN084 | N084 | |
| Issue Fee Payment ReceivedIFEE | IFEE | |
| Mail Notice of AllowanceAllowedMN/=. | MN/=. | |
| Notice of Allowance Data Verification CompletedAllowedN/=. | N/=. | |
| Case Docketed to Examiner in GAUDOCK | DOCK | |
| Date Forwarded to ExaminerFWDX | FWDX | |
| Response after Non-Final ActionA... | A... | |
| Request for Extension of Time - GrantedXT/G | XT/G | |
| Mail Non-Final RejectionNon-final rejectionMCTNF | MCTNF | |
| Non-Final RejectionNon-final rejectionCTNF | CTNF | |
| Case Docketed to Examiner in GAUDOCK | DOCK | |
| PG-Pub Issue NotificationPG-ISSUE | PG-ISSUE | |
| Case Docketed to Examiner in GAUDOCK | DOCK | |
| Transfer Inquiry to GAUTI1050 | TI1050 | |
| Transfer Inquiry to GAUTI1050 | TI1050 | |
| Transfer Inquiry to GAUTI1050 | TI1050 | |
| IFW TSS Processing by Tech Center CompleteTSSCOMP | TSSCOMP | |
| Application Dispatched from OIPEOIPE | OIPE | |
| Application Is Now CompleteCOMP | COMP | |
| Additional Application Filing FeesADDFLFEE | ADDFLFEE | |
| A statement by one or more inventors satisfying the requirement under 35 USC 115, Oath of the ApplicOATHDECL | OATHDECL | |
| Notice Mailed--Application Incomplete--Filing Date AssignedINCD | INCD | |
| Cleared by OIPE CSRL194 | L194 | |
| IFW Scan & PACR Auto Security ReviewSCAN | SCAN | |
| Initial Exam Team nnIEXX | IEXX |
7 legal events, as the office reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | |
|---|---|---|
| Lapsed due to failure to pay maintenance feeLapsedFP | FP | |
| Lapse for failure to pay maintenance feesLapsedPATENT EXPIRED FOR FAILURE TO PAY MAINTENANCE FEES (ORIGINAL EVENT CODE: EXP.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITYLAPS | LAPS | |
| Information on status: patent discontinuationPATENT EXPIRED DUE TO NONPAYMENT OF MAINTENANCE FEES UNDER 37 CFR 1.362STCH | STCH | |
| Fee payment procedureMAINTENANCE FEE REMINDER MAILED (ORIGINAL EVENT CODE: REM.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITYFEPP | FEPP | |
| Fee paymentFPAY | FPAY | |
| Information on status: patent grantGrantedPATENTED CASESTCF | STCF | |
| AssignmentAS | AS |
Numbers
- Publication
- 20080098374
- Publication, DOCDB
- 2008098374
- Publication, EPODOC
- US2008098374
- Application
- 11540817
- Application, DOCDB
- 54081706
- Application, EPODOC
- US20060540817
Titles
- English
- Method and apparatus for performing dynamic optimization for software transactional memory
Patent term adjustment
- A delay
- +895 daysthe office missed an examination deadline
- B delay
- +539 dayspendency past three years
- Overlap
- −225 daysdelays counted once
- Applicant delay
- −36 days
- Net adjustment
- 1,173 days
Classification
- CPC, 1
- G06F8/447
- IPC, 1
- G06F9 45
- USPC, 1
- 717145000