CN104111848B - Multi-thread software dynamic upgrading method based on asynchronous check points - Google Patents

Multi-thread software dynamic upgrading method based on asynchronous check points Download PDF

Info

Publication number
CN104111848B
CN104111848B CN201410305827.3A CN201410305827A CN104111848B CN 104111848 B CN104111848 B CN 104111848B CN 201410305827 A CN201410305827 A CN 201410305827A CN 104111848 B CN104111848 B CN 104111848B
Authority
CN
China
Prior art keywords
thread
dynamic update
software
function
mapping table
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.)
Active
Application number
CN201410305827.3A
Other languages
Chinese (zh)
Other versions
CN104111848A (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.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN201410305827.3A priority Critical patent/CN104111848B/en
Publication of CN104111848A publication Critical patent/CN104111848A/en
Application granted granted Critical
Publication of CN104111848B publication Critical patent/CN104111848B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a multi-thread software dynamic upgrading method based on asynchronous check points. The method includes the steps that based on a dynamic instrumentation mode, key codes are arranged in a source program in operation in an instrumentation mode at a binary level, not a source code level, so that upgrading does not need to depend on a specific compiler; based on an asynchronous check point algorithm, it can be guaranteed that all threads are in a blocked state before dynamic upgrading, so that all the threads are updated in a one-off mode, and expenditure caused by new and old version maintenance is avoided; a mode of binary system rewriting is adopted for function indirect skipping, and functions to be updated are upgraded, wherein the functions are not executed; a stack reconstruction mode can be used for upgrading functions to be updated in execution, so that in the dynamic upgrading process, unexpected waiting time which is caused by loop body and main function updating and others are eliminated. The loss, which is caused by downtime due to version maintenance, of applications and services (such as an electronic payment system) high in reliability requirement is reduced to the minimum, and cost caused by additional arrangement of redundancy hardware is reduced.

Description

A kind of multi-thread software dynamic update method based on asynchronous checkpointing
Technical field
The invention belongs to the security fields in software reliability research, more particularly, to a kind of asynchronous checkpointing is based on Multi-thread software dynamic update method.
Background technology
7/24 hour service reliability is provided in order to be directed to, from from the point of view of software, traditional Oftware updating method leads to The operation for stopping software often being required, restarting software after applying the update again can complete.Such stopping --- restarting mode not Destroy the execution of operation service with can avoiding, reduce the availability of software.From the angle of hardware, some schemes can increase Plus realize dynamic migration on the premise of server mirroring, until after upgrading is finished, data re-synchronization is returned into master server, so as to Ensure the reliability of application (service), but this scheme needs to buy extra redundant hardware, greatly increased and safeguards into This.In sum, it is possible to be lifted at sequence of threads (clothes well based on the multi-thread software dynamic update scheme of asynchronous checkpointing Business) reliability, reduce downtime, net income increase.In order to solve problem above, dynamic software update (DSU) arises, And become the eager new technology for needing at present.In the middle of dynamic software update, multithreading supports to be again a new challenge, because Identical function is performed for thread and attempt to change identical data, so it is difficult to ensure that the uniformity of data.
In general, many existing methods are all based on updating point that (data and code to be updated are not currently also adjusted Position referred to as updates point).Only could apply in some specific points that perform so when a runtime is updated, Such as code to be updated is not performed, and when data are unreferenced, otherwise system is easy to inconsistent state occur.
Had several drawbacks in that based on the method for updating point.Security update point can be found first is largely dependent upon volume Translate the analysis ability of device or programmer.For language flexible as C language, compiler is often difficult to analyze pointer and not Name.Therefore, they have to make conservative it is assumed that may produce wrong report in analysis result.Although the suggestion being recently proposed has Program is set to become renewable beneficial to conversion compiler, but their method is only applicable to single threaded application program, and cannot Maintain binary compatibility.So, it cannot be used for the binary file for compiling and current runs software.Next, it is difficult to Renewal point is found in multi-thread software, certain module possibly even neither one point of safes in a busy system.When being related to During data variation, for multi-thread software cannot analyze its updatability.If renewal point can not in time be reached or detected, certain A little security update will postpone, and fragile system may be exposed under external attack.Finally, for some based on a renewal point machine The dynamic update system of system, operator may reach security update in dynamic renewal process without any control in system During point applying the update, operator will know nothing.If operator cannot know whether system has completed current renewal, another The individual renewal in progress may be applied inadvertently.
In sum, the scheme of existing dynamic software upgrade system exists following not enough:
Some schemes (such as UpStare) need to rely on specific compiler, and when source program is recompilated, addition is related Dynamic update auxiliary code, this is impracticable for deployed application program;Some schemes (such as Polus) cannot The function that renewal is carrying out, needing wait function call to finish just can come into force, it means that if principal function has change, directly To program exit application program by forever cannot dynamic update Cheng Xin version;Some schemes then only have to single threaded application program Effect, it is clear that in today that multithread application is so popular, this is also unpractical.
The content of the invention
For the disadvantages described above or Improvement requirement of prior art, the invention provides a kind of based on the multi-thread of asynchronous checkpointing Journey software dynamic update method, it is intended that solution is existing to enter Mobile state liter for deployed multithread application The above-mentioned technical problem occurred in level, it is ensured that the feasibility of upgrading so that renewal process is not in indefinite wait.
For achieving the above object, according to one aspect of the present invention, there is provided a kind of multithreading based on asynchronous checkpointing Software dynamic update method, comprises the following steps:
(1) new and old edition of software to be upgraded is obtained, the project source file in new and old edition is extracted respectively, and respectively should The project source file of new and old edition is integrated;
(2) project source file and the project source file of legacy version to the redaction after integration is contrasted, to generate just Level patch;
(3) asynchronous checkpointing is inserted in primary patch, to generate dynamic update patch, is preserved wherein in asynchronous checkpointing The mapping relations of the continuation point of the new and old edition of software to be upgraded;
(4) the dynamic update patch of generation is loaded in the legacy version of operating software to be upgraded;
(5) initialization requests of receive user, and used according to the initialization requests to be updated in dynamic update patch Function name searches corresponding function body in internal memory, and the asynchronous checkpointing in step (3) is inserted in the function body;
(6) application request of receive user, and software to be upgraded is made using asynchronous checkpointing algorithm according to the application request In all threads reach blocked state;
(7) for the function and variable that are not used by the thread in software to be upgraded and perform, using binary rewrite Mode realize redirecting indirectly for function, for the function and variable that are currently in use in the thread in software to be upgraded and perform, Mapped and State Transferring by the way of storehouse reconstruct;
(8) recovered according to the mapping relations of the continuation point of the new and old edition preserved in asynchronous checkpointing in dynamic update patch All threads are performed, process terminates.
Preferably, step (1) is the integration that project source file is carried out using the pooling function in common intermediate language.
Preferably, it is, using dynamic pitching pile mode, to insert function body that step (5) inserts asynchronous checkpointing in function body Position is located at before head, the beginning of loop body, the function call of the function body.
Preferably, step (6) specifically includes following sub-step:
(6-1) application request of receive user, the application request includes the process ID and step of software to be updated (3) path of dynamic update patch file in;
(6-2) empty the first mapping table and the second mapping table is initialized, wherein the first mapping table represents that thread has been obtained Critical variable and assist the lock of dynamic update, the second mapping table represents that thread is wished the critical variable for obtaining and assisted dynamic The lock of state upgrading;
(6-3) lock of the shared critical variable to follow the trail of thread and assistance dynamic update is called by packing replacement system, When lock of the system every time to sharing critical variable and assistance dynamic update has operation, the first mapping in finding step (6-2) Table and the second mapping table, subsequently into step (6-4), if without if by critical variable name and the title of the lock for assisting dynamic update In being added to the first mapping table and the second mapping table, and in each variable or the Thread Id operated to it added behind of lock, so Step (6-4) is entered afterwards;
(6-4) judge that thread is to take the lock for assisting dynamic update, or take shared critical variable, if the former is then First its Thread Id is added in the second mapping table, if assisting the lock of dynamic update there is no Thread Id in the first mapping table, Its Thread Id is added in the first mapping table behind the lock for assisting dynamic update, and is assistance state by the thread marks, such as It is blocked state by the thread marks that really the lock of assistance dynamic update has Thread Id in the first mapping table;If the latter then first will Its Thread Id is added in the second mapping table, if corresponding shared critical variable does not have Thread Id in the first mapping table, will Its Thread Id is added in the first mapping table behind the shared critical variable, and is assistance state by the thread marks, if It is blocked state by the thread marks that corresponding shared critical variable has Thread Id in first mapping table;
(6-5) state of all threads is persistently checked, when finding to be in run states without thread, then association will be labeled as The thread block of state is helped, now all threads all enter blocked state, notice system can carry out follow-up dynamic update behaviour Make.
It is another aspect of this invention to provide that there is provided a kind of multi-thread software dynamic update system based on asynchronous checkpointing System, including:
First module, for obtaining the new and old edition of software to be upgraded, extracts respectively the project source file in new and old edition, And respectively by the project source file integration of the new and old edition;
Second module is right for carrying out to the project source file of the redaction after integration and the project source file of legacy version Than to generate primary patch;
3rd module, for asynchronous checkpointing to be inserted in primary patch, to generate dynamic update patch, wherein asynchronous inspection The mapping relations of the continuation point of the new and old edition of software to be upgraded are saved in making an inventory of;
4th module, for the dynamic update patch of generation to be loaded in the legacy version of operating software to be upgraded;
5th module, for the initialization requests of receive user, and uses dynamic update patch according to the initialization requests In function name to be updated search corresponding function body in internal memory, and the asynchronous checkpointing in the 3rd module is inserted into the function body In;
6th module, for the application request of receive user, and is made according to the application request using asynchronous checkpointing algorithm All threads in software to be upgraded reach blocked state;
7th module, for for the function and variable that are not used by the thread in software to be upgraded and perform, adopting The mode of binary rewrite realizes redirecting indirectly for function, for the letter for being currently in use and performing in the thread in software to be upgraded Number and variable, are mapped and State Transferring by the way of storehouse reconstruct;
8th module, for reflecting according to the continuation point of the new and old edition preserved in asynchronous checkpointing in dynamic update patch Penetrate relation to recover to perform all threads, process terminates.
In general, by the contemplated above technical scheme of the present invention compared with prior art, can obtain down and show Beneficial effect:
(1) not binary compatibility (not relying on specific compiler):The method of the present invention is simultaneously not used program transformation or weighs Build becomes renewable by program, and it obtains the control of patching process and changes the state of operation program using debugging API, this and Debugger realizes that principle is similar.Additionally, many restraining factors in type are eliminated not against point is updated, the method for the present invention Increased the flexibility of renewal.
(2) multithreading is supported:The difficult point for processing multi-thread software is to be possible to several threads to access simultaneously in renewal Data, the present invention is abandoned to adopt to update based on the method for updating point and applied immediately.Its tracking was attempted to facing in legacy version Bound variable carry out write access and using disposably update ensure by the way of all threads synchronization software only carry out call it is same The function and variable of one version, it is to avoid the inconsistency of data.
(3) Deadlock between thread is prevented:It is possible to different already at one before the update in view of some softwares Normal state such as some software internal errors or external attack.Therefore do not consider that these situations are likely to result in these softwares The failure of renewal, although it is unlikely for being fully solved these problems, cannot know correctly to run shape sometimes State, but the method for the present invention can pack replacement system and call to learn that each thread, whether in blocked state, is safeguarded WANT and HAVE lists can be prevented effectively from the Deadlock between thread.
(4) availability and manageability:In order to mitigate the burden of operator, the method for the present invention develops a kind of user circle Face facilitates whole renewal process.The information (process ID and patch title) that operator only needs to tell system a small amount of just can be using more Newly.Meanwhile, the process of patch installing is also visible for operator.In order to help user to build dynamic patch, the side of the present invention Method provides a source code to the compiler of source code, and it can recognize the semantic difference of new and old edition code.By some Simply manually adjust, dynamic patch can be automatically generated.
(5) low overhead:Due to legacy version is indicated using binary rewrite to the function call of redaction, this just only can be produced The little by little expense of raw function indirect addressing.And disposably update all threads using asynchronous checkpointing algorithm and complete storehouse weight Structure is carried out in the state of all threads are all in obstruction, in fact, such expense is very little, performance test shows For most of application programs, its expense is less than 5%.
Description of the drawings
Fig. 1 is flow chart of the present invention based on the multi-thread software dynamic update method of asynchronous checkpointing.
Fig. 2 (a) and (b) illustrate the Deadlock that asynchronous checkpointing algorithm can solve the problem that.
Fig. 3 illustrates that what function redirected indirectly realizes principle.
Fig. 4 illustrates the overview that storehouse is reconstructed.
Specific embodiment
In order that the objects, technical solutions and advantages of the present invention become more apparent, it is right below in conjunction with drawings and Examples The present invention is further elaborated.It should be appreciated that specific embodiment described herein is only to explain the present invention, and It is not used in the restriction present invention.As long as additionally, technical characteristic involved in invention described below each embodiment Not constituting conflict each other just can be mutually combined.
The Integral Thought of the present invention is that user can generate primary dynamic update and mend according to the open source software of new and old edition Fourth, is processed to primary dynamic update patch and compiling obtains dynamic update patch under conventional compiler, then loads dynamic State upgrade patch makes all threads of software to be updated reach blocked state using asynchronous checkpointing algorithm, makes for not being performed Function and variable take the mode for redirecting indirectly to be updated, for the function and variable that are carrying out using then take one Secondary property carries out the mode of storehouse reconstruct to all threads to update.
As shown in figure 1, the present invention is comprised the following steps based on the multi-thread software dynamic update method of asynchronous checkpointing:
(1) new and old edition of software to be upgraded is obtained, the project source file in new and old edition is extracted respectively, and respectively should The project source file of new and old edition is integrated;Specifically, it is using common intermediate language (Common Intermediate Language, abbreviation CIL) in merging (Merge) function carry out the integration of project source file;
(2) project source file and the project source file of legacy version to the redaction after integration is contrasted, to generate just Level patch;Specifically, it is using powerful online upgrade system (Powerful Live Updating System, abbreviation Polus) compare work, the primary patch of generation is the program file of .c types;
(3) asynchronous checkpointing is inserted in primary patch, to generate dynamic update patch;Specifically, by asynchronous inspection In the program file of the code insertion .c types of point, and it is compiled using conventional compiler (such as GCC), most throughout one's life Into the program file of .so types;Additionally, saving the continuation point of the new and old edition of software to be upgraded in asynchronous checkpointing The mapping relations of (Continuation point);
(4) the dynamic update patch of generation is loaded in the legacy version of operating software to be upgraded;
(5) initialization requests of receive user, and used according to the initialization requests to be updated in dynamic update patch Function name searches corresponding function body in internal memory, and the asynchronous checkpointing in step (3) is inserted in the function body;It is concrete and Speech, it is that, using dynamic pitching pile mode, the position for inserting function body is to be located at the function body that asynchronous checkpointing is inserted in function body Head, the beginning of loop body, function call before.
(6) application request of receive user, and software to be upgraded is made using asynchronous checkpointing algorithm according to the application request In all threads reach blocked state;This step specifically includes following sub-step:
(6-1) application request of receive user, the application request includes the process ID and step of software to be updated (3) path of dynamic update patch file in;
(6-2) empty the first mapping table (HAVE lists) and the second mapping table (WANT lists) is initialized, wherein first reflects Firing table represents the thread critical variable for having obtained and the lock (Lock) for assisting dynamic update, and the second mapping table represents that thread is wished Hope the critical variable for obtaining and the lock for assisting dynamic update;
(6-3) call to follow the trail of being total to for thread by packaging replacement (replaced with wrapper calls) system Enjoy critical variable and assist the lock of dynamic update, when system is every time to sharing critical variable and assisting the lock of dynamic update to have operation When, the first mapping table and the second mapping table in finding step (6-2), subsequently into step (6-4), by critical change if no Amount name and the title of lock of dynamic update is assisted to be added in the first mapping table and the second mapping table, and in each variable or lock The Thread Id that it is operated added behind, subsequently into step (6-4).
(6-4) judge that thread is to take the lock for assisting dynamic update, or take shared critical variable, if the former is then First its Thread Id is added in WANT lists, if assisting the lock of dynamic update there is no Thread Id in HAVE lists, by it Thread Id is added in HAVE lists behind the lock for assisting dynamic update, and is assistance (cooperate) shape by the thread marks State, has Thread Id by the thread marks to block (block) state if assisting the lock of dynamic update in HAVE lists;If The latter is then first added to its Thread Id in WANT lists, if corresponding shared critical variable does not have thread in HAVE lists ID, then be added to its Thread Id in HAVE lists behind the shared critical variable, and is assistance (run) by the thread marks State, if it is obstruction (block) state by the thread marks that corresponding shared critical variable has Thread Id in HAVE lists.
(6-5) state of all threads is persistently checked, when finding to be in run states without thread, then association will be labeled as The thread block of state is helped, now all threads all enter blocked state, notice system can carry out follow-up dynamic update behaviour Make.
(7) for the function and variable that are not used by the thread in software to be upgraded and perform, using binary rewrite Mode realize redirecting indirectly for function, specifically, by function body start binary code be substituted for jmp instruction, redirect To redaction function, variable is mapped to the memory address of redaction by the way of redirecting;And in software to be upgraded The function for being currently in use in thread and performing and variable, are mapped and State Transferring by the way of storehouse reconstruct, it is concrete and Speech, first saving scene, the value of data and register in record current function stack, then launch storehouse, according to field data With the information of function to be updated in the dynamic update patch in step (3), function parameter, return address, previous frame pointer are rewritten And local variable, the new function instruction of modification replacement.
(8) recovered according to the mapping relations of the continuation point of the new and old edition preserved in asynchronous checkpointing in dynamic update patch All threads are performed, process terminates, now runs software is performed now and the function that uses and variable are all new versions.
As shown in Fig. 2 (a) and (b), thread a, b, c, d, e, f normally runs, and monitoring process is updated during this time to should The signal that will be updated is sent with program.Thread a arrives first at checkpoint, and then it obtains the lock for assisting dynamic update, line Journey b, c, d also then arrive at checkpoint, but now assist the lock of dynamic update to be obtained by thread a, so they are in Blocked state, updating monitoring process can easily learn this feelings by assisting the exception catching of the lock of dynamic update Condition, but thread d has occupied critical variable temp1 before obstruction, now thread e will access critical variable temp1 and quilt just Obstruction, but the state that monitoring process is unable under normal circumstances Direct Acquisition thread e is updated, because being thrown without any exception Go out.But can easily find that thread e is blocked, shapes of the thread f in continuing executing with by WANT and HAVE lists State.If that is, the support without WANT and HAVE lists, when thread f also reaches blocked state, updates monitoring process All threads are not aware that all in blocked state, it still can be waited always, cause the deadlock of application program, by safeguarding WANT and HAVE lists just can successfully avoid the Deadlock between renewal process thread.
The method of the present invention method of the present invention inserts a jmp instruction by rewriteeing 5 bytes of function beginning instruction, But rewrite operation has damaged one or more instruction.Outside instruction rewrite operation, the method for the present invention is being immediately performed finger Two nop instructions of two bytes are inserted before order, because kernel deducts two bytes from EIP calling restarting system, if Ptrace has interrupted the execution that a system is called.In order to the help for not needing system after code update causes to apply journey Sequence is continued executing with, and the method for the present invention should preserve the presumptive instruction for being rewritten as jmp and nop instructions.However, work as should When being rewritten as the presumptive instruction of nop in another branch, perhaps the instruction changed can be directly executed, and this is possible to lead Cause illegal instruction errors.Then, (2 words are wanted in two nop instructions for other 4 of method of the present invention rewritten instructions or 7 bytes Section, a short jump jmp instruction wants 2 bytes or a long jump jmp instruction to want 5 bytes).Short jump jmp instructions are used for will control Stream processed jumps to another branch and can not possibly be direct overwritten the instruction for nop instructions.As shown in figure 3, entering by this two The mode that system rewrites, in the function body beginning insertion jump instruction of virtual memory address, when program calls again the function, it To perform along each instruction sequences in function body, and first instruction has been rewritten as jmp jump instructions, program will The code for jumping to redaction function is continued executing with, and so calls legacy version function actually but performing newly every time equivalent to program The instruction of version function.
Storehouse reconstruct includes two key steps, the preservation of stack information and the recovery of all function stack frames.In storehouse Recover the state of its existing storehouse of preservation before the state for updating in reconstruct.Storehouse reconstruct auxiliary code in order to reduce upgrade patch Size, in effectively preserving and recovering the text chunk in the independent memory field that the wrapper functions of stack frame are only run when rebuilding Generate.As shown in figure 4, function A, B are carrying out and are required for updating, if at this time all threads suspend in obstruction shape State, then the method for the present invention start the value of saving scene, record data and register, then launch storehouse, according to dynamic update The information of function to be updated in patch, again to the variable assignments in function stack frame, new function instruction is replaced in modification, wherein not Need part of the function in storehouse for updating not change much, need the data of function such as its redaction of A, B that update by The data mapping of legacy version is obtained, and register, relative virtual address equivalence will also be recalculated and obtained.
As it will be easily appreciated by one skilled in the art that the foregoing is only presently preferred embodiments of the present invention, not to The present invention, all any modification, equivalent and improvement made within the spirit and principles in the present invention etc. are limited, all should be included Within protection scope of the present invention.

Claims (5)

1. a kind of multi-thread software dynamic update method based on asynchronous checkpointing, it is characterised in that comprise the following steps:
(1) new and old edition of software to be upgraded is obtained, the project source file in new and old edition is extracted respectively, and it is respectively that this is new and old The project source file of version is integrated;
(2) project source file and the project source file of legacy version to the redaction after integration is contrasted, to generate primary benefit Fourth;
(3) asynchronous checkpointing is inserted in primary patch, to generate dynamic update patch, wherein saves in asynchronous checkpointing and treat The mapping relations of the continuation point of the new and old edition of upgrading software;
(4) the dynamic update patch of generation is loaded in the legacy version of operating software to be upgraded;
(5) initialization requests of receive user, and use function to be updated in dynamic update patch according to the initialization requests Name searches corresponding function body in internal memory, and the asynchronous checkpointing in step (3) is inserted in the function body;
(6) application request of receive user, and made in software to be upgraded using asynchronous checkpointing algorithm according to the application request All threads reach blocked state;
(7) for the function and variable that are not used by the thread in software to be upgraded and perform, using the side of binary rewrite Formula realizes redirecting indirectly for function, for the function and variable that are currently in use in the thread in software to be upgraded and perform, adopts The mode of storehouse reconstruct is mapped and State Transferring;
(8) recover to perform according to the mapping relations of the continuation point of the new and old edition preserved in asynchronous checkpointing in dynamic update patch All threads, process terminates.
2. multi-thread software dynamic update method according to claim 1, it is characterised in that step (1) is using general Pooling function in intermediate language carries out the integration of project source file.
3. multi-thread software dynamic update method according to claim 1, it is characterised in that step (5) is by asynchronous inspection It is that, using dynamic pitching pile mode, the position for inserting function body is head, the loop body for being located at the function body in point insertion function body Beginning, function call before.
4. multi-thread software dynamic update method according to claim 1, it is characterised in that step (6) specifically include with Lower sub-step:
(6-1) application request of receive user, the application request is included in the process ID and step (3) of software to be updated The path of dynamic update patch file;
(6-2) empty the first mapping table and the second mapping table is initialized, wherein the first mapping table represents that what thread obtained faces The lock of bound variable and assistance dynamic update, the second mapping table represents that thread is wished the critical variable for obtaining and assists dynamic to rise The lock of level;
(6-3) by packing replacement system and calling shared critical variable to follow the trail of thread and assist the lock of dynamic update, when being System every time to share critical variable and assist dynamic update lock have operation when, the first mapping table in finding step (6-2) and Second mapping table, subsequently into step (6-4), if without if by the title addition of critical variable name and the lock for assisting dynamic update To in the first mapping table and the second mapping table, and in each variable or the Thread Id operated to it added behind of lock, Ran Houjin Enter step (6-4);
(6-4) judge that thread is to take the lock for assisting dynamic update, or take shared critical variable, if the former then first will Its Thread Id is added in the second mapping table, if assisting the lock of dynamic update not have Thread Id in the first mapping table, by it Thread Id is added in the first mapping table behind the lock for assisting dynamic update, and is assistance state by the thread marks, if the It is blocked state by the thread marks that the lock of assistance dynamic update has Thread Id in one mapping table;If the latter is then first by its line Journey ID is added in the second mapping table, if corresponding shared critical variable does not have Thread Id in the first mapping table, by its line Journey ID is added in the first mapping table behind the shared critical variable, and is assistance state by the thread marks, if first It is blocked state by the thread marks that corresponding shared critical variable has Thread Id in mapping table;
(6-5) state of all threads is persistently checked, when finding to be in run states without thread, then will be labeled as assisting shape The thread block of state, now all into blocked state, notice system can carry out follow-up dynamic update operation to all threads.
5. a kind of multi-thread software dynamic update system based on asynchronous checkpointing, it is characterised in that include:
First module, for obtaining the new and old edition of software to be upgraded, extracts respectively the project source file in new and old edition, and divides The project source file of the new and old edition is not integrated;
Second module, for contrasting to the project source file of the redaction after integration and the project source file of legacy version, with Generate primary patch;
3rd module, for asynchronous checkpointing to be inserted in primary patch, to generate dynamic update patch, wherein asynchronous checkpointing In save software to be upgraded new and old edition continuation point mapping relations;
4th module, for the dynamic update patch of generation to be loaded in the legacy version of operating software to be upgraded;
5th module, for the initialization requests of receive user, and according to the initialization requests using treating in dynamic update patch The function name of renewal searches corresponding function body in internal memory, and the asynchronous checkpointing in the 3rd module is inserted in the function body;
6th module, for the application request of receive user, and makes to wait to rise according to the application request using asynchronous checkpointing algorithm All threads in level software reach blocked state;
7th module, for for the function and variable that are not used by the thread in software to be upgraded and perform, entering using two The mode that system rewrites realizes redirecting indirectly for function, for the function for being currently in use in the thread in software to be upgraded and performing and Variable, is mapped and State Transferring by the way of storehouse reconstruct;
8th module, for being closed according to the mapping of the continuation point of the new and old edition preserved in asynchronous checkpointing in dynamic update patch System recovers to perform all threads, and process terminates.
CN201410305827.3A 2014-06-27 2014-06-27 Multi-thread software dynamic upgrading method based on asynchronous check points Active CN104111848B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410305827.3A CN104111848B (en) 2014-06-27 2014-06-27 Multi-thread software dynamic upgrading method based on asynchronous check points

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410305827.3A CN104111848B (en) 2014-06-27 2014-06-27 Multi-thread software dynamic upgrading method based on asynchronous check points

Publications (2)

Publication Number Publication Date
CN104111848A CN104111848A (en) 2014-10-22
CN104111848B true CN104111848B (en) 2017-04-26

Family

ID=51708648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410305827.3A Active CN104111848B (en) 2014-06-27 2014-06-27 Multi-thread software dynamic upgrading method based on asynchronous check points

Country Status (1)

Country Link
CN (1) CN104111848B (en)

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105528231B (en) * 2016-01-21 2019-03-05 华中科技大学 A kind of software dynamic update method and system based on intermediate auxiliary function
CN105787367B (en) * 2016-02-23 2018-09-21 华中科技大学 A kind of the patch safety detecting method and system of software upgrading
EP3475817A1 (en) * 2016-06-28 2019-05-01 Amazon Technologies Inc. Asynchronous task management in an on-demand network code execution environment
CN106201476B (en) * 2016-06-29 2019-06-21 珠海豹趣科技有限公司 A kind of method, apparatus and electronic equipment constructing Hash Map
CN109766131B (en) * 2017-11-06 2022-04-01 上海宝信软件股份有限公司 System and method for realizing intelligent automatic software upgrading based on multithreading technology
US10853115B2 (en) 2018-06-25 2020-12-01 Amazon Technologies, Inc. Execution of auxiliary functions in an on-demand network code execution system
CN108897572B (en) * 2018-07-19 2020-09-15 北京理工大学 Complex type reconstruction method based on variable association tree
US11099870B1 (en) 2018-07-25 2021-08-24 Amazon Technologies, Inc. Reducing execution times in an on-demand network code execution system using saved machine states
CN109408090B (en) * 2018-10-09 2021-05-28 广东美的制冷设备有限公司 Upgrading method of equipment software, data converter and readable storage medium
US11943093B1 (en) 2018-11-20 2024-03-26 Amazon Technologies, Inc. Network connection recovery after virtual machine transition in an on-demand network code execution system
CN109918141B (en) * 2019-03-15 2020-11-27 Oppo广东移动通信有限公司 Thread execution method, thread execution device, terminal and storage medium
US11861386B1 (en) 2019-03-22 2024-01-02 Amazon Technologies, Inc. Application gateways in an on-demand network code execution system
US11119809B1 (en) 2019-06-20 2021-09-14 Amazon Technologies, Inc. Virtualization-based transaction handling in an on-demand network code execution system
CN110489140B (en) * 2019-07-11 2023-06-06 平安科技(深圳)有限公司 Software upgrading method and device, computer equipment and computer storage medium
US11714682B1 (en) 2020-03-03 2023-08-01 Amazon Technologies, Inc. Reclaiming computing resources in an on-demand code execution system
CN111930413B (en) * 2020-05-22 2023-07-21 无锡中感微电子股份有限公司 Automatic patch generation method, device and system
US11593270B1 (en) 2020-11-25 2023-02-28 Amazon Technologies, Inc. Fast distributed caching using erasure coded object parts
CN112433747B (en) * 2020-12-16 2022-11-25 深圳乐播科技有限公司 Differential upgrading method and system suitable for Software Development Kit (SDK)
CN112416379B (en) * 2021-01-21 2021-06-01 统信软件技术有限公司 Application program installation method and device, computing equipment and readable storage medium
CN113326039B (en) * 2021-06-21 2022-02-18 深圳市网通兴技术发展有限公司 Asynchronous code generation method and system for medical code flow modeling

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030208750A1 (en) * 2002-03-29 2003-11-06 Tapper Gunnar D. Information exchange for process pair replacement in a cluster environment
CN100337204C (en) * 2004-11-05 2007-09-12 华为技术有限公司 Online software updating method
US7543136B1 (en) * 2005-07-13 2009-06-02 Nvidia Corporation System and method for managing divergent threads using synchronization tokens and program instructions that include set-synchronization bits
US8732711B2 (en) * 2010-09-24 2014-05-20 Nvidia Corporation Two-level scheduler for multi-threaded processing

Also Published As

Publication number Publication date
CN104111848A (en) 2014-10-22

Similar Documents

Publication Publication Date Title
CN104111848B (en) Multi-thread software dynamic upgrading method based on asynchronous check points
US10698668B1 (en) Custom code transformations during compilation process
Makris et al. Dynamic and adaptive updates of non-quiescent subsystems in commodity operating system kernels
US7774636B2 (en) Method and system for kernel panic recovery
US6738926B2 (en) Method and apparatus for recovering a multi-threaded process from a checkpoint
CN105528231B (en) A kind of software dynamic update method and system based on intermediate auxiliary function
Chen et al. Dynamic software updating using a relaxed consistency model
US9208081B1 (en) Concurrent object management
US10831617B2 (en) Resilient programming frameworks for iterative computations on computer systems
CN103514032A (en) Method and computer system for restricting processing within a processor to facilitate transaction completion
JP2013514569A (en) Method, computer program product, and system for non-blocking dynamic update of statically typed class-based object-oriented software
CN110088736B (en) Self-tuning method and system
Niesler et al. HERA: Hotpatching of Embedded Real-time Applications.
CN104335186A (en) Processor assist facility
CN104487941A (en) Controlling an order for processing data elements during vector processing
CN109829313B (en) Method and device for defending SGX side channel attack based on code multiplexing programming
CN103631712B (en) A kind of medelling software critical behavior tracking based on memory management
US10877767B2 (en) Register restoring branch instruction
JP2022513382A (en) Methods, devices and computer storage media for achieving function jumps
JP4931711B2 (en) Kernel update method, information processing apparatus, program, and storage medium
Bratus et al. Katana: Towards patching as a runtime part of the compiler-linker-loader toolchain
US8689206B2 (en) Isolating operating system in-memory modules using error injection
US20100031357A1 (en) Defending Smart Cards Against Attacks by Redundant Processing
Baur Instrumenting Java bytecode to replay execution traces of multithreaded programs
US20090158267A1 (en) System and method for inserting authorized code into a program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant