CN101630268B - Synchronous optimization method and synchronous optimization equipment - Google Patents

Synchronous optimization method and synchronous optimization equipment Download PDF

Info

Publication number
CN101630268B
CN101630268B CN2009101629791A CN200910162979A CN101630268B CN 101630268 B CN101630268 B CN 101630268B CN 2009101629791 A CN2009101629791 A CN 2009101629791A CN 200910162979 A CN200910162979 A CN 200910162979A CN 101630268 B CN101630268 B CN 101630268B
Authority
CN
China
Prior art keywords
synchronous
invocation
point
version
synchronization object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN2009101629791A
Other languages
Chinese (zh)
Other versions
CN101630268A (en
Inventor
张昱
史成荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Science and Technology of China USTC
Original Assignee
University of Science and Technology of China USTC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Science and Technology of China USTC filed Critical University of Science and Technology of China USTC
Priority to CN2009101629791A priority Critical patent/CN101630268B/en
Publication of CN101630268A publication Critical patent/CN101630268A/en
Application granted granted Critical
Publication of CN101630268B publication Critical patent/CN101630268B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a synchronous optimization method and synchronous optimization equipment. The method comprises the following steps: carrying out static program analysis on a compiled method, confirming a synchronous method calling point without carrying out synchronous operation on a synchronous object in the compiled method according to an analysis result and marking the synchronous method calling point; compiling the called synchronous method according to the marked synchronous method calling point to generate a local code allowing to execute the synchronous operation on the synchronous object of the synchronous method; and executing the local code according to the marked synchronous method. The synchronous optimization method and the synchronous optimization equipment have high flexibility and favorable expandability.

Description

The method and apparatus of optimizing synchronously
Technical field
The present invention relates to computer technology, relate more specifically to synchronous optimisation technique.
Background technology
Java is a kind of programming language of on language level, supporting multi-thread programming, and it provides based on the method for synchronous of monitor mechanism and synchronization statements and is used for the synchronous of cross-thread.Each object has the monitor of a correspondence among the Java; Thread can call with synchronization statements through method for synchronous certain object is locked/release; Have only a thread can hold the lock on certain monitor, other threads of attempting that this monitor is locked all will get clogged and obtain the lock on this monitor up to them at every turn.
In order to guarantee multithreading safety; A lot of classes in the Java java standard library all must be designed to thread-safe; Just when the visit shared data, need add synchronous operation; Like java.util.Vector class, java.util.Hashtable class etc., application program can be used these storehouses simple and safely and provided in multi-thread environment function.Except can be through the class and method of calling each thread-safe in the Java java standard library, the programmer can also oneself utilize method for synchronous and synchronization statements to realize the exclusive reference of multithreading to shared data, to guarantee program correctness.Though the synchronization mechanism among the Java can guarantee the safety of multithreading easily, bring very large expense also for the operation of multithread programs.Show that according to research synchronization overhead accounts for the 5%-10% of total execution time usually; In the test to Marmot (a kind of Java optimizes compiler), 5 medium sized single-threading programs have spent for 26%~60% time on synchronously.Thus, it is crucial carrying out synchronous optimization (synchronization optimization).
Optimize the expense that is intended to reduce synchronous operation synchronously, improve the overall performance of program.In order to reduce the expense of synchronous operation, certain methods directly improves the realization of synchronization primitives, such as, thin lock (thin lock) technology keeps (lock reservation) technology with lock.Also have certain methods to utilize the static program analysis technology to analyze and eliminate unnecessary synchronous operation automatically, such as, lock cancellation (lock elision) technology and lock alligatoring (lock coarsening, lock coalescence) technology.Lock cancellation techniques make use escape analysis (escapeanalysis) technology is determined the object of thread local (thread-local), cancels the synchronous operation on these objects then.The lock coarsening technique merges some and acts on a plurality of synchronous operations on the same synchronization object; The code regional extent that can cause after merging being synchronized increases; This can cause the decline of program concurrency under the environment of multithreading; Especially under the very many situation of number of threads, to concurrency to influence meeting more obvious.
Therefore at present need a kind of scheme that have good dirigibility and extensibility and concurrency had the synchronous optimization of less influence.
Summary of the invention
In order one of to address the above problem; The present invention proposes a kind of synchronous optimization method; May further comprise the steps: to being carried out static program analysis by Compilation Method; Confirm the said method for synchronous point of invocation that need not be carried out synchronous operation in the Compilation Method according to analysis result, and said method for synchronous point of invocation is carried out mark synchronization object; Method for synchronous point of invocation according to said mark generates the local code that allows the synchronization object of said method for synchronous not to be carried out synchronous operation for its method for synchronous that calls compiling; Method for synchronous point of invocation according to said mark is carried out said local code.
According to embodiments of the invention; Said to being carried out static program analysis by Compilation Method; Confirm and need not the step that synchronization object carries out the method for synchronous point of invocation of synchronous operation be comprised: adjacent retaining zone and/or the nested retaining zone of amalgamation on same synchronization object, the method for synchronous point of invocation in the retaining zone that is included in after the said merging is confirmed as said redundant method for synchronous point of invocation.
According to embodiments of the invention; Said to being carried out static program analysis by Compilation Method, confirm and need not the step that synchronization object carries out the method for synchronous point of invocation of synchronous operation be comprised: whether share at a plurality of cross-threads whether the method for synchronous point of invocation of confirming said object is the method for synchronous point of invocation that need not carry out synchronous operation to synchronization object according to object.
According to embodiments of the invention; Whether share at a plurality of cross-threads whether the method for synchronous point of invocation of confirming said object is that the step that need not carry out the method for synchronous point of invocation of synchronous operation to synchronization object comprises according to object: if said object is only visited in the thread of the said object of establishment, the method for synchronous point of invocation that then will act on said object is confirmed as the said method for synchronous point of invocation that need not carry out synchronous operation to synchronization object.
According to embodiments of the invention; According to the method for synchronous point of invocation of said mark is that the method for synchronous compiling generates the step that allows not the synchronization object of said method for synchronous to be carried out the local code of synchronous operation and comprises: the method for synchronous point of invocation according to said mark is that said method for synchronous compiling generates the plaintext of said method for synchronous and the unsynchronized version of said method for synchronous, and the unsynchronized version of wherein said method for synchronous comprises ignores the local code that the synchronous operation on the synchronization object of said method for synchronous is generated.
According to embodiments of the invention; The step that allows for its method for synchronous that calls compiling generates not the synchronization object of said method for synchronous to be carried out the local code of synchronous operation according to the method for synchronous point of invocation of said mark comprises: the method for synchronous point of invocation according to said mark is branch's version that said method for synchronous compiling generates said method for synchronous, and before the said method for synchronous point of invocation that is labeled, inserts the instruction that label information is set.Branch's version of wherein said method for synchronous obtains through following steps: insert instruction that obtains label information and the instruction of removing mark in said method for synchronous porch; Before the synchronous operation that acts on the synchronization object of said method for synchronous, insert branch instruction; Said branch instruction is judged the label information that obtains, if said label information is true, then jumps to after the said synchronous operation; If said label information is false, then carry out said synchronous operation.
According to embodiments of the invention; The step of carrying out said local code comprises: when carrying out the method for synchronous point of invocation; If the method for synchronous point of invocation that said method for synchronous point of invocation is a mark; Then call the local code of said unsynchronized version,, then call the local code of said plaintext if said method for synchronous point of invocation is the method for synchronous point of invocation that does not have mark.
According to embodiments of the invention, the step of carrying out said local code comprises: when implementing the method for synchronous point of invocation, according to the local code of the said branch of the label information instruction calls version that is provided with before the said method for synchronous point of invocation.
According to embodiments of the invention, do not carry out the method for synchronous point of invocation is confirmed as the step that need not carry out the method for synchronous point of invocation of synchronous operation to synchronization object when being undertaken by Compilation Method in the static program analysis one of following situation occurring: act between adjacent method for synchronous point of invocation and the synchronous operation on the same synchronization object and comprise the synchronous operation that acts on other objects; Comprise the operation of visiting variable volatile data between said adjacent method for synchronous point of invocation and the synchronous operation that acts on the same synchronization object; Comprise visit or the method call that static state can't be resolved between said adjacent method for synchronous point of invocation and the synchronous operation that acts on the same synchronization object; Comprise circulation between said adjacent method for synchronous point of invocation and the synchronous operation that acts on the same synchronization object; Comprise the inconsistent operation of locking number of times between said adjacent method for synchronous point of invocation and the synchronous operation that acts on the same synchronization object, the blocked number of times of each forerunner's node of the control flow graph CFG node under the inconsistent operation of said locking number of times is different.
The invention allows for a kind of synchronous optimizing equipment, comprise analysis module, collector and execution module.Wherein, said analysis module is used for confirming the said method for synchronous point of invocation that need not be carried out synchronous operation in the Compilation Method to synchronization object according to analysis result, and said method for synchronous point of invocation being carried out mark being carried out static program analysis by Compilation Method; Said collector is used for generating the local code that allows the synchronization object of said method for synchronous not to be carried out synchronous operation according to the method for synchronous point of invocation of said mark for its method for synchronous that calls compiling; Said execution module is used for carrying out said local code according to the method for synchronous point of invocation of said mark.
The method and apparatus of synchronous optimization proposed by the invention has the dirigibility of height and good extensibility.
Description of drawings
Above-mentioned and/or additional aspect of the present invention and advantage are from obviously with easily understanding becoming the description of embodiment below in conjunction with accompanying drawing, wherein:
Fig. 1 is the process flow diagram of synchronous optimization method according to an embodiment of the invention;
Fig. 2 is the synoptic diagram of the code release of method for synchronous according to an embodiment of the invention;
Fig. 3 is an according to an embodiment of the invention pair of version algorithm synoptic diagram;
Fig. 4 is a branch according to an embodiment of the invention version algorithm synoptic diagram;
Fig. 5 is the synoptic diagram of synchronous optimizing equipment according to an embodiment of the invention;
Fig. 6 is the handling capacity contrast synoptic diagram when method of application is inline according to an embodiment of the invention not;
Fig. 7 is the handling capacity contrast synoptic diagram of method of application according to an embodiment of the invention after inline.
Embodiment
Describe embodiments of the invention below in detail, the example of said embodiment is shown in the drawings.Be exemplary through the embodiment that is described with reference to the drawings below, only be used to explain the present invention, and can not be interpreted as limitation of the present invention.
Optimize when improving the synchronization overhead of application program synchronously, also expended bigger process analysis expense.For expense and the income optimized synchronously between trade-off process, the present invention is optimized the point of invocation of method for synchronous, because: 1) in the code of reality, method for synchronous calls the synchronization overhead of being spent and in total synchronization overhead, accounts for very big proportion; 2) relatively simple to the analysis of the point of invocation of method for synchronous.
As one embodiment of the present of invention, the synchronization object of the method for synchronous of a static (being the homochronousness method) is meant the corresponding Class object of class under this method; The synchronization object of a non-static method for synchronous (being the instance method for synchronous) is meant this object of this method; The synchronization object of a synchronization statements is meant the object of explicit appointment in the parenthesis in this synchronization statements, i.e. O among the synchronization statements synchronized (O) { ... }.
In bytecode level, the synchronization statements of language level is transformed into monitorenter (lock, promptly obtain the monitor on the synchronization object) instruction beginning, with the instruction sequence of monitorexit (release promptly discharges corresponding monitor) order fulfillment.Method for synchronous then is in its constant pool clauses and subclauses, to be provided with synchronous mark ACC_SYNCRONIZED in bytecode level; The method call instruction can be checked this sign; When calling a method that is provided with this sign (during the invoke synchronous method); Current thread will be obtained monitor, call manner of execution body itself then, all will discharge this monitor no matter method call is normal termination or abnormal ending.For ease of describing, unification is represented respectively object O is locked and release with lock (O) and unlock (O) among the present invention.
As one embodiment of the present of invention, a retaining zone that acts on object O is meant the code zone that is locked into one section instruction sequence formation of carrying out continuously of this object release from this object is added.
The present invention proposes a kind of method for synchronous optimization framework of optimizing method for synchronous and point of invocation thereof; Its basic thought is to analyze to carry out synchronous method for synchronous point of invocation to synchronization object; It is made into the calling of the unsynchronized version of this method for synchronous, or label information is set and calls branch's version of this method for synchronous.This framework was made up of process analysis, compiling and 3 stages of execution.Sketch this 3 stages below respectively.
Be illustrated in figure 1 as the process flow diagram of synchronous optimization method 100 according to an embodiment of the invention.As shown in the figure, this method 100 may further comprise the steps:
S101: to being carried out static program analysis, confirm the method for synchronous point of invocation that need not be carried out synchronous operation in the Compilation Method, and this method for synchronous point of invocation is carried out mark to synchronization object according to analysis result by Compilation Method.This step or title program analysis phase.
As one embodiment of the present of invention; When compiler carries out compile time to a method in the java applet; To being carried out static program analysis by Compilation Method; Confirm by which synchronous operation of method for synchronous point of invocation on its synchronization object in the Compilation Method it is redundant according to analysis result, and these method for synchronous points of invocation are carried out mark.
As one embodiment of the present of invention; In this stage; Can adopt the different programs analytical technology to come to being analyzed by Compilation Method to confirm that which method for synchronous point of invocation needs mark; These analytical technologies can be based on the lock coarsening technique, also can be based on escape analysis technology, or other technologies.
As one embodiment of the present of invention, program analysis phase can adopt the process analysis based on the lock alligatoring.
As one embodiment of the present of invention, based on the main thought of synchronous optimization of lock alligatoring be: if thread T obtains same lock during obtaining lock and discharging this lock, the 2nd lock obtains that to operate be unnecessary so; If thread T continuous several times obtains also to discharge same lock, so can with these locks obtain and lock releasing operation be merged into a pair of, to reduce the quantity of latching operation.
As one embodiment of the present of invention, the main method of method for synchronous point of invocation that need not be synchronous based on lock coarsening technique analysis identification comprises: adjacent retaining zone or the nested retaining zone of amalgamation on same synchronization object is to reduce the quantity of synchronous operation.Regard a kind of special retaining zone as and let it merge mutually if call method for synchronous with adjacent retaining zone or the retaining zone that comprises it; The synchronous operation of method for synchronous point of invocation on its synchronization object that is included in so in the retaining zone after the merging is redundant, thereby can carry out mark to these points of invocation.
As one embodiment of the present of invention, program analysis phase can adopt the process analysis based on escape analysis.
As one embodiment of the present of invention, based on the main thought of the synchronous optimization of escape analysis be:, so just can delete the synchronous operation of thread T to O if certain thread T carries out not having other threads T ' that O is conducted interviews during the synchronous operation to object O.In java application, often some to seem be that single-threaded program is used the assisting thread among the JDK, these programs are actually multithreading, but the single-threaded shared data of the assisting thread and the application program of getting along well; Can identify the object of some thread locals based on escape analysis, these objects only are created its thread accesses, to the visit of these objects be do not need synchronous.
As one embodiment of the present of invention, whether share to determine whether deleting the synchronous operation that acts on this object according to an object at a plurality of cross-threads.If object O only in the thread of creating it by visit (be O do not escape out thread); Then all synchronous operations (that the method for synchronous that comprises O calls is related, to the synchronous operation of O) that act on O are redundant, thereby can carry out mark to any point of invocation of the method for synchronous of O.
Need to prove, the purpose of program analysis phase be analyze identify need not be synchronous the method for synchronous point of invocation, except program analysis technique and escape analysis technology, can also adopt other technology based on the lock alligatoring.As long as this technology can identify need not be synchronous the method for synchronous point of invocation, this technology just can be used by the program analysis phase of method for synchronous optimization framework of the present invention.
S102: the method for synchronous point of invocation according to said mark is that the method for synchronous compiling generates the local code that allows the synchronization object of method for synchronous not to be carried out synchronous operation, this step or title compilation phase.
As one embodiment of the present of invention, as required, can adopt two version policies or branch's version policy is the local code that the method for synchronous compiling generates different editions.
As one embodiment of the present of invention, two version policies can comprise: be the local code that a method for synchronous compiling generates two versions, one is the plaintext of this method, and another is the unsynchronized version of this method.As one embodiment of the present of invention, the plaintext of a method for synchronous is meant the local code that the code of this method is compiled generation by usual manner.The unsynchronized version of a method for synchronous is meant when the code of this method of compiling, ignores the local code that all synchronous operations on the synchronization object of this method are generated.
As one embodiment of the present of invention, branch's version policy can comprise: be the local code that a method for synchronous compiling generates branch's version, and before the method for synchronous point of invocation that is labeled, insert the instruction that label information is set.As one embodiment of the present of invention, branch's version of a method for synchronous is meant when the code of this method correspondence of compiling, increases as follows and handle: (a) insert one in the method porch and obtain the instruction of label information and the instruction of a removing mark; (b) act on the synchronous operation on the synchronization object of this method for each, before it, insert a branch instruction, this branch instruction is judged the label information that obtains, if true, then jump to after this synchronous operation, otherwise, carry out this synchronous operation.
Be illustrated in figure 2 as the synoptic diagram of the different code version of method for synchronous according to an embodiment of the invention.Instance method for synchronous setSharedField () with among Fig. 2 (a) is an example, (b) among Fig. 2, (c) and (d) provide the false code of its plaintext, unsynchronized version and branch's version respectively.In (b) figure, respectively this object is locked and release with needing afterwards before the code in the manner of execution body; In (c) figure, the code in the direct manner of execution body; In (d) figure, the label information marked when at first obtaining current method and being called removes mark then, and then each being acted on locking on this object, to increase branch instruction with unlocking operation be that fictitious time just is performed to guarantee that these operate in marked.
Two version policies and branch's version policy have relative merits separately.Two version policies are the local code that a method for synchronous generated and preserved two versions; And branch's version policy only need generate and preserve the local code of a version for a method for synchronous, so two version policy needs the additional space expense and need the virtual machine kernel to support the management to many versions local code.On the other hand; Two version policies are to add the current branch operation that whether is labeled that calls of judging this method in the local code of each version of generating of method for synchronous; Branch's version policy has then added extra this type branch operation, so branch's version can influence the run time behaviour of program to a certain extent.
It is few but call the high situation of frequency that two version policies are fit to those method for synchronous numbers that are labeled, and it is many and call the low situation of frequency that branch's version policy then is fit to those method for synchronous numbers that are labeled.When carrying out method for synchronous optimization, can decide according to the characteristics of application program to be to use two version policies also to be to use branch's version policy, or design a kind of heuritic approach, let compiler select only strategy automatically.
S103: the method for synchronous point of invocation according to mark is carried out local code, this step or title execute phase.This stage is responsible for carrying out local code, and what it was taked according to the compilation phase is two version policies or branch's version policy and slightly different.
As one embodiment of the present of invention, if the compilation phase takes is two version policies, when implementing the point of invocation of a method for synchronous; If cross this point of invocation at the program analysis phase mark; Then call the local code of its unsynchronized version, otherwise, the local code of its plaintext called.
As one embodiment of the present of invention; If what the compilation phase taked is branch's version policy; When implementing the point of invocation of a method for synchronous, whether mark is crossed this point of invocation determines whether being provided with label information according to program analysis phase, calls the local code of its branch's version then.
Above-described method for synchronous optimization method comprises process analysis, compiling and execution three phases, and preceding two stages can be taked different strategies respectively.Below introduce the several examples of application of method for synchronous optimization framework, promptly based on two version method for synchronous optimized Algorithm (be called for short two version alligatoring algorithms) of lock alligatoring, based on branch's version method for synchronous optimized Algorithm (being called for short branch's version alligatoring algorithm) of lock alligatoring, based on two version method for synchronous optimized Algorithm (being called for short pair version escape algorithms) of escape analysis with based on branch's version method for synchronous optimized Algorithm (abbreviation branch version escape algorithm) of escape analysis etc.
Two version alligatoring algorithms are meant that the program analysis phase in the method for synchronous optimization framework adopts lock alligatoring analytical technology, compilation phase to adopt two formed method for synchronous optimized Algorithm of version policy; Branch's version alligatoring algorithm refers to adopt lock alligatoring analytical technology, compilation phase to adopt the formed method for synchronous optimized Algorithm of branch's version policy at the program analysis phase of method for synchronous optimization framework; Two version escape algorithms refer to adopt escape analysis technology, compilation phase to adopt two formed method for synchronous optimized Algorithm of version policy at the program analysis phase of method for synchronous optimization framework; Branch's version escape algorithm refers to adopt escape analysis technology, compilation phase to adopt the formed method for synchronous optimized Algorithm of branch's version policy at the program analysis phase of method for synchronous optimization framework.
As one embodiment of the present of invention, two version alligatoring algorithms comprise following two parts:
1) utilize the instant compiler (JIT) of Java Virtual Machine that each is carried out process analysis and conversion by the CFG of Compilation Method (control flow graph), carry out operation as follows:
(a) find and act on adjacent method for synchronous point of invocation and synchronous operation on the same synchronization object, that can merge, they are merged and are marked at the method for synchronous point of invocation that merges in the zone.
(b) inner at the synchronization statements piece that acts on certain synchronization object, find to act on synchronous operation on this synchronization object, that can merge and method for synchronous point of invocation, delete these method for synchronous points of invocation of these synchronous operations and mark.
2) revise the compiling of the responsible Java of coordination method in the Java Virtual Machine and the assembly of execution, promptly compile streamline and virtual machine kernel VMCore.When implementing a method for synchronous point of invocation,, check whether the local code of the plaintext of this method for synchronous exists if this point of invocation is not labeled; If exist; Then carry out it, compile the local code that generates plaintext for it, carry out it then otherwise start the jit compiling streamline; If this point of invocation is labeled, check whether the local code of the unsynchronized version of this method for synchronous exists, if exist, then carry out it, otherwise start the local code that jit compiling generates unsynchronized version, carry out it then.
As one embodiment of the present of invention, there is one of scenario if act between adjacent method for synchronous point of invocation and the synchronous operation on the same synchronization object, then can not carry out above-mentioned optimizing process:
Condition 1: comprise the synchronous operation that acts on other objects.
Condition 2: comprise the operation of variable (volatile) data of visit.
Condition 3: comprise visit or method call that static state can't be resolved.
Condition 4: comprise circulation.
Condition 5: certain operation is different corresponding to the blocked number of times of each forerunner's node of the node among the CFG.
Wherein, condition 1~3rd is for the code that prevents to carry out after retaining zone merges obtains different locks and the possibility produce of deadlock with different order; Condition 3~4th merges the retaining zone that produces super large and the concurrency that reduces multithread programs in order to prevent retaining zone; Condition 5 is a kind of complicated situations, and the probability that this situation occurs is almost 0, so this algorithm is not handled this situation.
As one embodiment of the present of invention, branch's version alligatoring algorithm utilizes the instant compiler of Java Virtual Machine that each is carried out process analysis and conversion by the CFG of Compilation Method, carries out operation as follows:
(a) find and act on adjacent method for synchronous point of invocation and synchronous operation on the same synchronization object, that can merge, they are merged and before these method for synchronous points of invocation, insert a mark instructions (this instruction is changed to label information very).
(b) inner at the synchronization statements piece that acts on certain synchronization object; Find and act on synchronous operation on this synchronization object, that can merge and method for synchronous point of invocation; Delete these synchronous operation, and before these method for synchronous points of invocation, insert a mark instructions (this instruction is changed to label information very).
(c) if current be the method for synchronous that mark is crossed by Compilation Method, be that its conversion generates the local code of branch's version.
The same with two version alligatoring algorithms, if act on one of existence condition 1~5 between adjacent method for synchronous point of invocation and the synchronous operation on the same synchronization object, then can not carry out above-mentioned optimizing process.
As one embodiment of the present of invention; Two version escape algorithms and branch's version escape algorithm adopt the escape analysis technology at the program analysis phase of method for synchronous optimization framework; If the result of escape analysis shows object O certain thread of not escaping out; Be object O only by this thread accesses, then can carry out mark to all method for synchronous points of invocation that act on synchronization object O.
As one embodiment of the present of invention, for two version escape algorithms, with two version alligatoring classes of algorithms seemingly, also need revise compiling streamline and virtual machine kernel VMCore.When implementing a method for synchronous point of invocation,, check whether the local code of the plaintext of this method for synchronous exists if this point of invocation is not labeled; If exist; Then carry out it, otherwise start the local code that the compiling of jit compiling streamline generates plaintext, carry out it then; If this point of invocation is labeled, check whether the local code of the unsynchronized version of this method for synchronous exists, if exist, then carry out it, otherwise start the local code that jit compiling generates unsynchronized version, carry out it then.
As one embodiment of the present of invention,, also need before the method for synchronous point of invocation that each mark is crossed, insert a mark instructions mark (), and each method for synchronous that will be labeled is compiled into the local code of branch's version for branch's version escape algorithm.
It should be noted that method for synchronous optimization framework proposed by the invention is very flexible, its preceding two stages all can be taked different strategies respectively, and each stage selects Different Strategies can be combined into different optimized Algorithm.Can use different combinations according to different application requirements.
Except the dirigibility of height, this framework also has another advantage, and that is exactly good extensibility.The program analysis phase of this framework can also adopt other strategy except can adopting lock alligatoring and escape analysis, need only this strategy can identify need not be synchronous the method for synchronous point of invocation, can be as the phase one of this method for synchronous optimization framework.A kind of new strategy of the every increase of the program analysis phase of method for synchronous optimization framework just can make up respectively with 2 kinds of strategies of this strategy and compilation phase, thereby generates new optimized Algorithm.
As one embodiment of the present of invention, can on the Java SE platform Apache Harmony that increases income, realize two version alligatoring algorithms and branch's version alligatoring algorithm with C++, introduce the realization of these two algorithms below respectively for example.
Two version alligatoring algorithms refer to adopt the lock coarsening technique at the program analysis phase of method for synchronous optimization framework, and the compilation phase is adopted the algorithm of two version policies, and this algorithm comprises two parts:
1) utilize the instant compiler of Harmony that each is carried out process analysis and conversion by the CFG of Compilation Method, the arthmetic statement of this process is following:
Input: the CFG of the current method that is compiled
Output: the CFG after the conversion
Process: comprise two stages of process analysis and code conversion, its basic framework is following:
doubleOptimization(){
ProgramAnalyse (); // process analysis
Transform (); // code conversion
}
Be illustrated in figure 3 as the synoptic diagram of according to an embodiment of the invention pair of version algorithm.Wherein O.syncCall () instruction is that O.Call () instruction is calling the local code of unsynchronized version to the calling of the local code of the plaintext of this method for synchronous.The pseudo-CFG (promptly the node among the figure may not be strict fundamental block node) that shows with Fig. 3 is that example is simply described it.
ProgramAnalyse (): utilize JIT to be carried out process analysis by the intermediate representation of Compilation Method to current; Find the adjacent method for synchronous point of invocation that acts on the same synchronization object; Like the O.syncCall1 () among Fig. 3, O.syncCall2 () and O.syncCall3 (); And synchronous operation, like lock among Fig. 3 (O) and unlock (O).
Transform (): carried out code conversion to current by the intermediate representation of Compilation Method according to these method for synchronous points of invocation that find and synchronous operation, its detailed process is following:
(a) find these adjacent method for synchronous points of invocation and in the synchronous operation first,, before it, insert lock (O) instruction like the O.syncCall1 () among Fig. 3; Find these adjacent method for synchronous points of invocation and last in the synchronous operation,, after it, insert unlock (O) instruction like the O.syncCall3 () among Fig. 3.
(b) be marked at these method for synchronous points of invocation that find among the programAnalyse (), like the O.syncCall1 () among Fig. 3, O.syncCall2 () and O.syncCall3 (); These synchronous operations that deletion is found in programAnalyse () are like lock among Fig. 3 (O) and unlock (O).
(c) for before the code conversion not in retaining zone but after code conversion involved fundamental block in the retaining zone; Like the fundamental block D among Fig. 3; If after code conversion; Never exist the fundamental block in retaining zone like the stream of the control from fundamental block C to fundamental block D limit among Fig. 3, then need insert lock (O) instruction to the control stream limit of this fundamental block on this limit; If after code conversion, exist from this fundamental block to the control stream limit of the fundamental block retaining zone not, like the stream of the control from fundamental block D to fundamental block E limit among Fig. 3, need on this limit, insert unlock (O) instruction.
(d) revise compiling streamline and virtual machine kernel VMCore.When implementing a method for synchronous point of invocation, if this point of invocation is not labeled, then carry out the local code of its plaintext, carry out it then; If this point of invocation is labeled, like the O.syncCall1 () among Fig. 3, O.syncCall2 () and O.syncCall3 (), then carry out the local code of its unsynchronized version, like the O.Call1 () among Fig. 3, O.Call2 () and O.Call3 ().
As one embodiment of the present of invention, branch's version alligatoring algorithm refers to adopt the lock coarsening technique at the program analysis phase of method for synchronous optimization framework, and the compilation phase is adopted the algorithm of branch's version policy, and its arthmetic statement is following:
Input: the CFG of the current method that is compiled
Output: the CFG after the conversion
Process: comprise process analysis, code conversion and tap changing three phases, its basic framework is following:
branchOptimization(){
ProgramAnalyse (); // process analysis
Transform (); // code conversion
Branch (); // tap changing
}
Be illustrated in figure 4 as the synoptic diagram of branch according to an embodiment of the invention version algorithm.Wherein O.syncCall () instruction is that O.brCall () instruction is calling branch's version local code to the calling of this method for synchronous plaintext local code.The pseudo-CFG that shows with Fig. 4 below is that example is simply described.
ProgramAnalyse (): utilize JIT to be carried out process analysis by the intermediate representation of Compilation Method to current; Find the adjacent method for synchronous point of invocation that acts on the same synchronization object; Like the O.syncCall1 () among Fig. 4, O.syncCall2 () and O.syncCall3 (); And synchronous operation, like lock among Fig. 4 (O) and unlock (O).
Transform (): carried out code conversion to current by the intermediate representation of Compilation Method according to these method for synchronous points of invocation that find and synchronous operation, its detailed process is following:
(a) find these adjacent method for synchronous points of invocation and in the synchronous operation first,, before it, insert lock (O) instruction like the O.syncCall1 () among Fig. 4; Find these adjacent method for synchronous points of invocation and last in the synchronous operation,, after it, insert unlock (O) instruction like the O.syncCall3 () among Fig. 4.
(b) insert a mark instructions mark () before these method for synchronous points of invocation that in programAnalyse (), find; Like the O.syncCall1 () among Fig. 4, O.syncCall2 () and O.syncCall3 (); These synchronous operations that deletion is found in programAnalyse () are like lock among Fig. 4 (O) and unlock (O).
(c) for before the code conversion not in retaining zone but after code conversion involved fundamental block in the retaining zone; Like the fundamental block D among Fig. 4, if after code conversion, never existing, the fundamental block in retaining zone flows the limit to the control of this fundamental block; Like the stream of the control from fundamental block C to fundamental block D limit among Fig. 4; Need on this limit, insert lock (O) instruction,, exist from this fundamental block to the control stream limit of the fundamental block retaining zone not if after code conversion; Like the stream of the control from fundamental block D to fundamental block E limit among Fig. 4, need on this limit, insert unlock (O) instruction.
Branch (): if current be method for synchronous by Compilation Method, it is transformed into branch's version, its detailed process is following:
(a) insert an instruction and an instruction of removing mark that obtains label information in the method porch, like marked=getMark () in the entry block among Fig. 4 and clearMark () instruction.
(b) for the synchronous operation on the synchronization object that acts on this method; Like lock among Fig. 4 (O1) and unlock (O1), before it, insert a branch instruction, this branch instruction judges whether the label information marked that obtains is true; If it is true; Then jump to after this synchronous operation, otherwise, this synchronous operation carried out.
It should be noted that; As one embodiment of the present of invention; No matter be two version alligatoring algorithms or branch's version alligatoring algorithm, satisfy one of above-mentioned condition 1~5, then can not be optimized if act between adjacent method for synchronous point of invocation and the synchronous operation on the same synchronization object.Like fundamental block A, B and the D among Fig. 3 and Fig. 4,, all can not be optimized if satisfy any in the above-mentioned condition 1~5.
Be illustrated in figure 5 as the synoptic diagram of synchronous optimizing equipment according to an embodiment of the invention.As shown in the figure, this synchronous optimizing equipment comprises analysis module, collector and execution module.Wherein,
Analysis module is used for confirming by the method for synchronous point of invocation that existence need not be synchronous on synchronization object in the Compilation Method according to analysis result, and this method for synchronous point of invocation being carried out mark being carried out static program analysis by Compilation Method.
The method for synchronous point of invocation that collector is used for according to mark is that the method for synchronous compiling generates the local code that allows the synchronization object of said method for synchronous not to be carried out synchronous operation.
Execution module is used for carrying out said local code according to the method for synchronous point of invocation of mark.
Method for synchronous optimization method and equipment that the present invention proposes mainly contain following three advantages:
The first, method for synchronous optimization method of the present invention and equipment have the flexible of height, can be according to different demands, and the Different Strategies in each stage of independent assortment generates different optimized Algorithm.
The second, method for synchronous optimization method of the present invention and equipment are with good expansibility, if a kind of program analysis method can identify need not be synchronous the method for synchronous point of invocation, just can be applied to phase one of this method for synchronous optimization framework.
The 3rd; The optimized Algorithm that on the basis of method for synchronous optimization method of the present invention and equipment, designs is the synchronization optimization algorithm of interprocedual; Can not only delete the synchronous operation that a large amount of process inter-sync algorithms can't be deleted; And the acquisition of the expense of general procedure inter-sync optimized Algorithm has been alleviated expense and has been optimized the contradiction between the effect near interprocedual optimization Algorithm effect.
The inventor has realized two version alligatoring algorithms and branch's version alligatoring algorithm based on this method for synchronous optimization framework on the Java SE platform Apache Harmony that increases income, this framework can likewise be applied on other Java Virtual Machines.The inventor tests the realization of method for synchronous optimized Algorithm as test procedure with SPECjbb2005.
Table 1 has provided the quantity of various synchronous operations among the SPECjbb2005; The wherein static quantity of analyzing the various synchronous operations that come out when dynamically representing through compile-time analysis with operation is respectively represented the quantity of various synchronous operations among the inline front and back SPECjbb2005 of manner of execution respectively after inline (inline) is preceding and inline.Each methods analyst in the static compile-time analysis application programs once, it can not accurately reflect the various synchronous operation quantity that program is carried out when actual motion, but can reflect how many static optimizable chances that exists has among the SPECjbb2005; Can accurately reflect the various synchronous operation quantity that program is carried out and analyze information (dynamically row) collected, statistics during dynamic operation when actual motion, thereby can reflect accurately that synchronization optimization algorithm is to the whole procedure Effect on Performance.Locks in the table representes the quantity of all monitorenter; Unlocks representes the quantity of all monitorexit; The quantity of the monitorenter that inserted Locks inserts when representing to adopt the lock coarsening technique; The quantity of the monitorexit that insertedUnlocks inserts when representing to adopt the lock coarsening technique; Removed Locks representes the quantity of the monitorenter that optimized Algorithm is deleted; Removed Unlocks representes the quantity of the monitorexit that optimized Algorithm is deleted, and Sync-Methods is the quantity of all method for synchronous, and optSync-Methods is the quantity of method for synchronous that in two version policies, has the local code of unsynchronized version.For static information; Sync method Callsites representes the quantity of all method for synchronous points of invocation; Opt sync methods Callsites is illustrated in the quantity of the method for synchronous point of invocation that all were labeled in the method for synchronous optimized Algorithm, the quantity of promptly optimised method for synchronous point of invocation.For multidate information, sync method Callsites representes the total degree that method for synchronous is performed, and opt syncmethods Callsites representes the total degree that all optimised method for synchronous points of invocation are performed.
The quantity statistics of various synchronous operations among the table 1SPECjbb2005
Figure G2009101629791D00161
Can find out from table 1, can only delete the synchronous operation on the synchronization object in the method for synchronous that is labeled before inline, 61 of can delete in 61 method for synchronous of method for synchronous optimized Algorithm add latching operation, in addition can not delete any latching operation that adds.After inline since a large amount of method for synchronous by in be linked in the method for its caller and become the synchronization statements piece; In the caller method, just occurred to delete the chance that adds latching operation in a large number; Data from table can be found out; Can delete 431 after inline and add latching operation, 29 that wherein comprise in 29 method for synchronous add latching operation.
Static information from table 1 can find out that no matter be before inline or after inline, the quantity of optimised method for synchronous point of invocation is all quite big, and the chance that inline front and back all exist a large amount of method for synchronous to optimize is described.Multidate information from table 1 can find out, inline front and back no matter, the actual number of times that is performed of the method for synchronous of optimizing all quite more than.Therefore, no matter whether compiler is supported inlinely, and the method for synchronous optimized Algorithm can both play the effect of better optimized method for synchronous.
It can also be seen that from table 1 quantity of the synchronous operation of inserting in order to guarantee Program Semantic not to be changed is much smaller than the quantity of the synchronous operation of deleting; The quantity of optimised method for synchronous is compared the total quantity of method for synchronous and is wanted much little; And the code of method for synchronous is all considerably less generally speaking, means that for two version alligatoring algorithms the additional storage space expense of the local code of preserving unsynchronized version can be very little.
Adopt the local code of two version policies, need some extra storage space expenses for two versions of each method for synchronous that need optimize generation.
Table 2 has provided the storage space of SPECjbb2005 spent local code under various situation; Do not carry out the storage space of all local code needs when method is inline does not use two version alligatoring algorithm yet when wherein none representes to carry out, do not carry out the inline but storage spaces all local code needs when using pair version alligatoring algorithm of method when none&syncOpt representes to carry out.Can find out from the data shown in the table,, only increase by about 5.6% storage space not using the additional storage space expense that two version policies produce when inline to have only 83324 bytes.Inline in the table representes to carry out the inline but storage spaces all local code needs when not using two version alligatoring algorithm of method; Inline&syncOpt representes to carry out method storage space inline and all local code needs when using two version alligatoring algorithm; Can find out from the data shown in the table; The additional storage space expense that two version policies produce when method of application is inline has only 114428 bytes, only increases by about 7.5% storage space.This shows that two version policies are little to the extra storage expense that SPECjbb2005 produces.If to some application programs, two version algorithms can produce very large additional storage space expense, then can consider to use branch's version policy.
The spent local code storage space (unit: byte) of SPECjbb2005 under the various situation of table 2
Figure G2009101629791D00171
The inventor has constructed the Java Virtual Machine of different editions SPECjbb2005 has been tested; The platform that experiment is used is Intel (R) Core (TM) 2 Quad CPU Q66002.40GHz; 3GB internal memory, operating system are Windows XP, partial test result such as Fig. 6 and shown in Figure 7.
Fig. 6 be according to an embodiment of the invention 3 kinds not the inline Java Virtual Machine of method of application carry out handling capacity (bops:business operation per second) the contrast synoptic diagram of SPECjbb2005 gained.Wherein, When representing to carry out, do not use none any synchronous optimization; When representing to carry out, uses branch branch's version alligatoring synchronization optimization algorithm; Use two version alligatoring synchronization optimization algorithm when double representes to carry out, improvement1 and improvement2 represent that respectively branch is with respect to none, the double handling capacity raising rate with respect to none.The 1st~3 of tables of data the row is respectively 6 groups of test results that use is not used the virtual machine (being designated as branch) of the virtual machine of any synchronous optimization (being designated as none), application branch version alligatoring algorithm, used virtual machine (being designated as double) the execution SPECjbb2005 of two version alligatoring algorithms among the figure.Back 2 row in the tables of data are respectively branch with respect to none, the double handling capacity raising rate with respect to none.Because the process internal lock alligatoring algorithm of Stoodley etc. almost improves synchronous nothing when method of application is not inline, so not contrast with it here.Visible from Fig. 6; Branch's version alligatoring algorithm and two version alligatoring algorithms all can improve the handling capacity of SPECjbb2005; And two version alligatoring algorithms are to high than branch's version alligatoring algorithm of the raising rate of handling capacity; This is that these branch instructions will consume working time, thereby influence the improvement of handling capacity because branch's version alligatoring algorithm can add the branch instruction that judges whether to need to carry out synchronous operation in some method for synchronous.But, the superior performance of two version alligatoring algorithms improve with more compile time expense and storage overhead be cost.
Fig. 7 is the handling capacity contrast synoptic diagram that the inline Java Virtual Machine of 4 kinds of method of application according to an embodiment of the invention is carried out the SPECjbb2005 gained; Wherein, When representing to carry out, do not use inline any synchronous optimization; When representing to carry out, used inline&Stoodley the synchronization optimization algorithm of Stoodley etc.; When representing to carry out, uses inline&branch branch's version alligatoring synchronization optimization algorithm; Use the test result of two version alligatoring synchronization optimization algorithm when inline&double representes to carry out, improvement1, improvement2, improvement3 represent respectively inline&Stoodley with respect to inline, inline&branch with respect to inline, inline&double handling capacity raising rate with respect to inline.Among the figure the 1st~4 of tables of data the row be respectively use application process inline but do not use the virtual machine (being designated as inline) of any synchronous optimization, use the virtual machine (being designated as inline&Stoodley) of the alligatoring algorithm of Stoodley etc. in inline back, use the virtual machine (being designated as inline&branch) of branch's version alligatoring algorithm in inline back, 6 groups of test results that the virtual machine (being designated as inline&double) of using two version alligatoring algorithms in inline back is carried out SPECjbb2005.Back 3 row in the tables of data be respectively inline&Stoodley with respect to inline, inline&branch with respect to inline, inline&double handling capacity raising rate with respect to inline.Therefrom visible, three kinds of synchronization optimization algorithm can both be improved handling capacity, and the improvement that two version alligatoring algorithm and branch's version alligatoring algorithm are brought is higher than the improvement that algorithm brought of Stoodley etc.Can know that from table 1 the execution number of times that method for synchronous calls in inline back reduces to 87182262 by 612136827, this is owing to carrying out the method body that the most method for synchronous points of invocation in inline back are replaced by these method for synchronous.In addition, reduced owing to use the branch instruction digital display work that needs to carry out synchronous operation that judges whether that branch's version alligatoring algorithm produced in inline back, so the branch instruction that branch's version alligatoring algorithm is brought has also alleviated Effect on Performance.Can see that from Fig. 7 inline&branch and inline&double are much the same to the raising rate of handling capacity.
Can know to the improvement situation of handling capacity that by branch's version alligatoring algorithm among Fig. 6 and Fig. 7 and two version alligatoring algorithms two kinds of algorithms improvement after inline are all higher than corresponding improvement before inline.This mainly be because: when not carrying out when inline; The new retaining zone that lock alligatoring algorithm forms can comprise method call and return or even to the operations such as compiling of the method for synchronous that do not compile; These operations cause new retaining zone longer, thereby have a strong impact on the concurrency of multithread programs.After inline; Because most of method for synchronous point of invocation is replaced by the method body of method for synchronous; So the method call in the new retaining zone that lock alligatoring algorithm forms with return and the operations such as compiling of the method for synchronous that do not compile significantly reduced; Thereby new retaining zone is shorter relatively, and concurrency will improve.
Although illustrated and described embodiments of the invention; For those of ordinary skill in the art; Be appreciated that under the situation that does not break away from principle of the present invention and spirit and can carry out multiple variation, modification, replacement and modification that scope of the present invention is accompanying claims and be equal to and limit to these embodiment.

Claims (10)

1. a synchronous optimization method is characterized in that, may further comprise the steps:
To being carried out static program analysis, confirm the said method for synchronous point of invocation that need not be carried out synchronous operation in the Compilation Method according to analysis result, and said method for synchronous point of invocation is carried out mark synchronization object by Compilation Method;
Method for synchronous point of invocation according to said mark generates the local code that allows the synchronization object of said method for synchronous not to be carried out synchronous operation for its method for synchronous that calls compiling;
Method for synchronous point of invocation according to said mark is carried out said local code.
2. synchronous optimization method according to claim 1 is characterized in that, and is said to being carried out static program analysis by Compilation Method, confirms need not the step that synchronization object carries out the method for synchronous point of invocation of synchronous operation be comprised:
Adjacent retaining zone and/or the nested retaining zone of amalgamation on same synchronization object confirmed as the said method for synchronous point of invocation that need not carry out synchronous operation to synchronization object with the method for synchronous point of invocation in the retaining zone that is included in after the said merging.
3. synchronous optimization method according to claim 1 is characterized in that, and is said to being carried out static program analysis by Compilation Method, confirms need not the step that synchronization object carries out the method for synchronous point of invocation of synchronous operation be comprised:
Whether share at a plurality of cross-threads whether the method for synchronous point of invocation of confirming said object is the method for synchronous point of invocation that need not carry out synchronous operation to synchronization object according to object.
4. synchronous optimization method according to claim 3; It is characterized in that whether share to confirm to the method for synchronous point of invocation of said object it whether is need not the step that synchronization object carries out the method for synchronous point of invocation of synchronous operation be comprised at a plurality of cross-threads according to object:
If said object is only visited in the thread of creating said object, the method for synchronous point of invocation that then will act on said object is confirmed as the said method for synchronous point of invocation that need not carry out synchronous operation to synchronization object.
5. synchronous optimization method according to claim 1; It is characterized in that the step that allows for its method for synchronous that calls compiling generates not the synchronization object of said method for synchronous to be carried out the local code of synchronous operation according to the method for synchronous point of invocation of said mark comprises:
Method for synchronous point of invocation according to said mark is that said method for synchronous compiling generates the plaintext of said method for synchronous and the unsynchronized version of said method for synchronous,
The unsynchronized version of wherein said method for synchronous comprises ignores the local code that the synchronous operation on the synchronization object of said method for synchronous is generated.
6. synchronous optimization method according to claim 1; It is characterized in that the step that allows for its method for synchronous that calls compiling generates not the synchronization object of said method for synchronous to be carried out the local code of synchronous operation according to the method for synchronous point of invocation of said mark comprises:
Method for synchronous point of invocation according to said mark is branch's version that said method for synchronous compiling generates said method for synchronous, and before the said method for synchronous point of invocation that is labeled, inserts the instruction that label information is set,
Branch's version of wherein said method for synchronous obtains through following steps: insert instruction that obtains label information and the instruction of removing mark in said method for synchronous porch; Before the synchronous operation that acts on the synchronization object of said method for synchronous, insert branch instruction; Said branch instruction is judged the label information that obtains, if said label information is true, then jumps to after the said synchronous operation; If said label information is false, then carry out said synchronous operation.
7. synchronous optimization method according to claim 5 is characterized in that, the step of carrying out said local code comprises:
When carrying out the method for synchronous point of invocation; If the method for synchronous point of invocation that said method for synchronous point of invocation is a mark; Then call the local code of said unsynchronized version,, then call the local code of said plaintext if said method for synchronous point of invocation is the method for synchronous point of invocation that does not have mark.
8. synchronous optimization method according to claim 6 is characterized in that, the step of carrying out said local code comprises:
When implementing the method for synchronous point of invocation, according to the local code of the said branch of the label information instruction calls version that is provided with before the said method for synchronous point of invocation.
9. synchronous optimization method according to claim 1 is characterized in that, does not carry out the method for synchronous point of invocation is confirmed as the step that need not carry out synchronous operation to synchronization object when being undertaken by Compilation Method in the static program analysis one of following situation occurring:
Act between adjacent method for synchronous point of invocation and the synchronous operation on the same synchronization object and comprise the synchronous operation that acts on other objects;
Comprise the operation of visiting volatile data between said adjacent method for synchronous point of invocation and the synchronous operation that acts on the same synchronization object;
Comprise visit or the method call that static state can't be resolved between said adjacent method for synchronous point of invocation and the synchronous operation that acts on the same synchronization object;
Comprise circulation between said adjacent method for synchronous point of invocation and the synchronous operation that acts on the same synchronization object;
Comprise the inconsistent operation of locking number of times between said adjacent method for synchronous point of invocation and the synchronous operation that acts on the same synchronization object, the blocked number of times of each forerunner's node of the control flow graph node under the inconsistent operation of said locking number of times is different.
10. a synchronous optimizing equipment is characterized in that, comprises analysis module, collector and execution module, wherein,
Said analysis module is used for confirming the said method for synchronous point of invocation that need not be carried out synchronous operation in the Compilation Method to synchronization object according to analysis result, and said method for synchronous point of invocation being carried out mark being carried out static program analysis by Compilation Method;
Said collector is used for generating the local code that allows the synchronization object of said method for synchronous not to be carried out synchronous operation according to the method for synchronous point of invocation of said mark for its method for synchronous that calls compiling;
Said execution module is used for carrying out said local code according to the method for synchronous point of invocation of said mark.
CN2009101629791A 2009-08-20 2009-08-20 Synchronous optimization method and synchronous optimization equipment Expired - Fee Related CN101630268B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101629791A CN101630268B (en) 2009-08-20 2009-08-20 Synchronous optimization method and synchronous optimization equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101629791A CN101630268B (en) 2009-08-20 2009-08-20 Synchronous optimization method and synchronous optimization equipment

Publications (2)

Publication Number Publication Date
CN101630268A CN101630268A (en) 2010-01-20
CN101630268B true CN101630268B (en) 2012-07-04

Family

ID=41575386

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101629791A Expired - Fee Related CN101630268B (en) 2009-08-20 2009-08-20 Synchronous optimization method and synchronous optimization equipment

Country Status (1)

Country Link
CN (1) CN101630268B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108170543B (en) * 2017-12-26 2021-06-01 上海展扬通信技术有限公司 Kernel code and synchronization processing method and device of upper layer code of Kernel code
WO2019241979A1 (en) * 2018-06-22 2019-12-26 Huawei Technologies Co., Ltd. Method of deadlock detection and synchronization-aware optimizations on asynchronous processor architectures
CN112269581B (en) * 2020-12-24 2021-07-02 北京清微智能科技有限公司 Memory coupling compiling method and system for reconfigurable chip

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1591335A (en) * 2003-08-26 2005-03-09 微软公司 Data flow analysis of transactional processes
WO2006128891A2 (en) * 2005-06-03 2006-12-07 International Business Machines Corporation Shared memory synchronization
CN1961292A (en) * 2004-06-03 2007-05-09 英特尔公司 Thread synchronization methods and apparatus for managed run-time environments

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1591335A (en) * 2003-08-26 2005-03-09 微软公司 Data flow analysis of transactional processes
CN1961292A (en) * 2004-06-03 2007-05-09 英特尔公司 Thread synchronization methods and apparatus for managed run-time environments
WO2006128891A2 (en) * 2005-06-03 2006-12-07 International Business Machines Corporation Shared memory synchronization

Also Published As

Publication number Publication date
CN101630268A (en) 2010-01-20

Similar Documents

Publication Publication Date Title
Stadler et al. Partial escape analysis and scalar replacement for Java
US8104028B2 (en) Method for JIT compiler to optimize repetitive synchronization
Aldrich et al. Static analyses for eliminating unnecessary synchronization from Java programs
Avgustinov et al. Making trace monitors feasible
CN101681294B (en) Method and system for memory transaction grouping
EP2049992B1 (en) Software transactional protection of managed pointers
US8473935B2 (en) Just-ahead-of-time compilation
US20080040560A1 (en) Lightweight Single Reader Locks
US7743368B2 (en) Method and apparatus for providing class hierarchy information for function devirtualization
US6345384B1 (en) Optimized program code generator, a method for compiling a source text and a computer-readable medium for a processor capable of operating with a plurality of instruction sets
Bebenita et al. Trace-based compilation in execution environments without interpreters
Hayashizaki et al. Improving the performance of trace-based systems by false loop filtering
Wang et al. An adaptive task creation strategy for work-stealing scheduling
US7451438B2 (en) Method, system and product for identifying and executing locked read regions and locked write regions in programming languages that offer synchronization without explicit means to distinguish between such regions
Prokopec et al. Making collection operations optimal with aggressive JIT compilation
Afek et al. Lowering STM overhead with static analysis
CN101630268B (en) Synchronous optimization method and synchronous optimization equipment
Lin et al. Speculative register promotion using advanced load address table (alat)
JP2006196002A (en) Software tool including modeling of asynchronous program flow
Itzstein et al. On implementing high level concurrency in Java
Nakaike et al. Lock elision for read-only critical sections in java
Pieper et al. Structured stream parallelism for rust
Giunta et al. Using aspects and annotations to separate application code from design patterns
US20050149945A1 (en) Method and system of re-reserving object locks without causing reservation thrash
US20040243792A1 (en) Efficiently releasing locks when an exception occurs

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120704

Termination date: 20150820

EXPY Termination of patent right or utility model