CN105045563B - A kind of method for collision management for speculating nested software transaction storage - Google Patents
A kind of method for collision management for speculating nested software transaction storage Download PDFInfo
- Publication number
- CN105045563B CN105045563B CN201510346790.3A CN201510346790A CN105045563B CN 105045563 B CN105045563 B CN 105045563B CN 201510346790 A CN201510346790 A CN 201510346790A CN 105045563 B CN105045563 B CN 105045563B
- Authority
- CN
- China
- Prior art keywords
- affairs
- write
- conflict
- priority
- value
- 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
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of method for collision management for speculating nested software transaction storage, there is provided the collision detector and conflict resolution device that the nested software transaction the levied storage that thread is submitted with serializing is realized in thread-level supposition technology.Collision detector uses the random back conflict resolution method based on dynamic priority using visible lazy collision detection method, conflict resolution device is read on the basis of thread is submitted in serializing.Collision detection method in the present invention largely reduces the collision detection loss in issued transaction, the conflict resolution method of the present invention then effectively alleviates the conflict resolution inefficiency caused because resolving strategy is improper, so as to improve whole system performance.
Description
Technical field
The invention belongs to transaction management field, and in particular to a kind of conflict management side of the nested software transaction storage of supposition
Method.
Background technology
With developing rapidly for computer hardware, polycaryon processor has been widely used for industrial design and daily life
In.The check figure of nominal increase processor, then executable instruction number will just have growth at double, but on polycaryon processor
The existing a large amount of serial programs of operation do not obtain the effect of expected acceleration, and this is due to serial program on polycaryon processor
Can not be automatic paralleling and accelerated.Therefore how existing serial program is accelerated to have become science using polycaryon processor
Boundary and the hot research problem of industrial quarters concern.
Affairs memory technology and thread-level speculate that technology turns into and improve serial program execution efficiency on polycaryon processor
Key technology.Affairs memory technology, which is efficiently solved in Traditional parallel programming model, uses lock and Semaphore Mechanism to realize thread
Between synchronization/mutual exclusion and the problems such as the deadlock, the Priority Inversion that are brought to the access of shared resource.Thread-level speculates
Technology has broken cross-thread and has relied on the limitation performed to thread parallel, can further excavate the concurrency of program, effectively improve
The scalability of program.
The affairs memory technology for supporting that thread-level speculates existing at present does not support that subtransaction is stored or only either
Subtransaction is reduced to the affairs of single level.Subtransaction is by allowing two affairs to carry out nesting when not conflicting semantically
Handle to improve the performance of affairs storage, but the introducing of subtransaction also brings complexity and more punchings in logic
It is prominent.Conflict is not only the bottleneck of affairs memory technology, is also the bottleneck of thread-level supposition technology, how effectively to detect conflict,
Conflict is cleared up, is the key for improving systematic function.Therefore, for speculating that nested software transaction is stored, a kind of conflict management is designed
Method is very required.
The content of the invention
It is above-mentioned to overcome it is an object of the invention to provide a kind of method for collision management for speculating nested software transaction storage
The defect that prior art is present.
To reach above-mentioned purpose, the present invention is adopted the following technical scheme that:
A kind of method for collision management for speculating nested software transaction storage, comprises the following steps:
Step 1:Create affairs;
Step 2:Read operation or write operation are carried out to created affairs, if carrying out read operation, into step 3, if carrying out
Write operation, then into step 5;
Step 3:Read-after-write conflict has been detected whether during read operation, if so, then entering step 4, if nothing, has been entered
Step 5;
Step 4:Read-after-write conflict is cleared up during read operation, and judges whether conflict clears up, if so, then entering
Enter step 5, if it is not, then entering step 9;
Step 5:Judge whether affairs terminate, if so, then entering step 6, if it is not, then returning to step 2;
Step 6:Affairs are submitted, and have detected whether write after write conflict or writeafterread conflict, if so, then entering step
Rapid 7, if nothing, into step 8;
Step 7:Write after write conflict or writeafterread conflict are cleared up during submission, and judge whether conflict disappears
Solution, if so, then entering step 8;If it is not, then entering step 9;
Step 8:Affairs are submitted successfully;
Step 9:Abandon affairs.
Further, conflict has been detected whether by collision detector in step 3 and step 6, if collision detector includes
Dry object, each object includes readset and closes, writes set and write version number, and the readset closes to point to has read operation to the object
Affairs, each transaction nodes include affairs ID, value and read version number, affairs perform write operation when, it is necessary to update reading version
Number value;It is described write set and point to there are the affairs of write operation to the object, each transaction write running node include affairs ID,
Value, newly it is worth and writes version number, version number is write, it is necessary to update when affairs perform write operation, and is stored in new value.
Further, the row of advancing by leaps and bounds of being liquidated in step 4 and step 7 by conflict resolution device is cleared up, and conflict resolution device is each
Affairs create a manager node, and each manager node includes priority, time started, number of attempt, termination number of times, father
Affairs ID, father's affairs priority, read number of times and write number of times.
Further, read operation comprises the following steps in step 2:
Step 2.1:Object s is searched in set in writing for affairs tx and affairs tx ancestors, if not finding, into step
2.2, if finding, into step 2.4;
Step 2.2:Object s, if finding, direct returning an object value s value, if not are searched in affairs tx readset is closed
Find, then into step 2.3;
Step 2.3:Object s is searched in the readset of affairs tx ancestors is closed, object s and its reading version number is incorporated to after finding
Affairs tx readset is closed, and returns to write-in value of the last successful affairs submitted to object s before affairs are performed;
Step 2.4:Judge whether to the last write operation affairs of object s be exactly affairs tx, if so, by object s value and its
Write version number and be incorporated to affairs tx readset conjunction, and return to the value that there is write operation in affairs tx to object s;If it is not, then entering step
Rapid 2.5;
Step 2.5:Judge whether affairs tx and ancestors to object s write operations are the brotgher of node, if so, after then existing and writing
Read conflict, and the row of advancing by leaps and bounds of liquidating clears up, if it is not, by object s value and its write version number and be incorporated to affairs tx readset and close, and return
There is the value of write operation in affairs tx to object s.
Further, affairs submission comprises the following steps in step 6:
Step 6.1:Judge the submission serial number for submitting global sequence number serial whether to be less than affairs tx, if so, then etc.
Treat, if it is not, then entering step 6.2;
Step 6.2:Check that all object s whether there is writeafterread conflict in the conjunction of affairs tx readsets, if in the presence of to conflict
Cleared up and enter step 6.5, if being not present, the relevant information of affairs in subclass is incorporated to during superset is closed and enters step
Rapid 6.3;
Step 6.3:Check that affairs tx writes all object s in set and whether there is write after write conflict, if in the presence of to conflict
Cleared up and enter step 6.5, if being not present, object s value and version number in affairs tx, which are copied to, to write in set has pair
Object s carried out the affairs of operation and entered step 6.4;
Step 6.4:The readset for emptying affairs tx closes and writes set, and global sequence number serial plus 1, subsequently into step
Rapid 6.5;
Step 6.5:Terminate.
Further, check that all object s whether there is the method that writeafterread conflicts in the conjunction of affairs tx readsets in step 6.2
For:Traverse object s reading set search and global write version number identical read the affairs tx ' corresponding to version number, if affairs tx '
Be exactly affairs tx fraternal affairs it is follow-up, then there is writeafterread conflict.
Further, check that affairs tx writes all object s in set and whether there is the method that write after write conflicts in step 6.3
For:Traverse object s write set search and global write version number identical writes affairs tx ' corresponding to version number, if affairs tx '
Be exactly affairs tx fraternal affairs it is follow-up, then there is write after write conflict.
Further, the method for conflict resolution is:The priority original state of all affairs is set to 0, works as affairs
When clashing, compare the priority of affairs, stop the small affairs of priority, the priority of root affairs=reading number of times+writes number of times *
2+ timestamps, priority=timestamp+father's affairs priority+reading number of times+of subtransaction writes number of times * 2.
Further, conflict resolution is comprised the following steps that:
1) conflict resolution device is initialized:Affairs tx is recorded respectivelyiAnd txjTimestamp, and initialize affairs txiAnd txj
Termination number of times, read number of times, write number of times, priority, father's affairs ID and father's affairs priority;
2) affairs are kept out of the way:If read operation opening or write operation open failure, allow affairs to avoid at random, and will attempt to beat
Open number of times and plus 1, if number of attempt is more than given threshold, stop affairs;
3) conflict resolution:If affairs txjIt is txiDuring the descendant node of brother, then tx is abandonedj, and by txjIt is merged into txi's
In father node, then terminate and destroy conflict resolution device;If affairs txjIt is not txiDuring the descendant node of brother, then tx is initializedi
And txjAnd its priority is calculated, by comparing the two priority, abandon the small affairs of priority, and increase transaction abort number of times,
Then terminate and destroy conflict resolution device.
Further, the situation whether conflict of judging clears up has following two:One, in two affairs clashed, if
One affairs is descendant node then transaction retraction rollback of another affairs brother, the conflict resolution if revocation rollback success,
Otherwise conflict and do not clear up;Two, when an affairs are not the descendant nodes of another affairs brother if cancel and the punching of rollback two
The low affairs of priority in prominent affairs, the conflict resolution if revocation rollback success, otherwise do not clear up.
Compared with prior art, the present invention has following beneficial technique effect:
Affairs serial sequenceization is needed to submit due to performing affairs using supposition, the side of collision detection method one in the present invention
The WAW and RAW that face effectively avoids common transaction in cross-thread and thread are relied on, and another aspect subtransaction is clashed only
When an affairs are the descendant nodes of the brotgher of node of another affairs.Therefore, the collision detection method in the present invention is very big
The collision detection loss in issued transaction is reduced in degree.The conflict resolution method of the present invention is used based on dynamic priority
Random back strategy arbitrates the conflict occurred between affairs.Random back strategy based on dynamic priority is by the beginning of affairs
Between, open number of times, the quantity of random-backoff time and transactions access object forms the dynamic priorities of affairs after integrating, abandon punching
The small affairs of priority in prominent affairs.The conflict resolution method effectively alleviates the conflict caused because resolving strategy is improper
Inefficiency is cleared up, so as to improve whole system performance.
Brief description of the drawings
Fig. 1 is implementation procedure schematic diagram of the invention;
Fig. 2 is collision detector metadata structure of the invention;
Fig. 3 is conflict resolution device metadata structure of the invention;
The read operation flow chart that Fig. 4 stores for the nested software transaction of supposition of the present invention;
Fig. 5 submits operational flowchart for the affairs of the nested software transaction storage of supposition of the present invention.
Embodiment
The present invention is described in further detail below in conjunction with the accompanying drawings:
The present invention proposes a kind of collision detection for speculating nested software transaction storage and conflict resolution method.Present invention solution
The technical scheme that certainly its technical problem is used is as follows:
1) collision detection
Affairs are divided into three classes parallel:Cross-thread affairs are parallel, affairs are parallel in thread and subtransaction is parallel.Subtransaction
Affairs is parallel in the parallel and thread of the parallel not only support cross-thread of supposition, also supports thread is nested with affairs parallel.Due to
There was only writeafterread (WAR) dependence when affairs are parallel in cross-thread and thread, therefore for the affairs t in cross-thread and threadiWith
tj, tiIn tjSubmit before, tjRead affairs s value and in tjThe t performed afterwardsiTo affairs s write-in value val2, then tiAnd tj
There is writeafterread conflict need to meet tj≠ti, i.e.,ti< tjAnd read (tj,s,val)<write(ti,s,
Val2), then tiAnd tjThere is WAR conflicts need to meet tj≠ti.Then there is write after write in the subtransaction that subtransaction speculates
(WRW), three kinds of conflicts of writeafterread (WAR) and read-after-write (RAW).Affairs t for belonging to TiAnd tj, tiIn tjSubmit before, tj
To affairs s write-in value val1 and in tjThe t performed afterwardsiTo affairs s write-in value val2, then tiAnd tjThere is write after write conflict
T need to be metjIt is tiFraternal affairs it is follow-up;Affairs t for belonging to TiAnd tj, tiIn tjSubmit before, tjRead affairs s's
It is worth and in tjThe t performed afterwardsiTo affairs s write-in value val, then tiAnd tjThere is writeafterread conflict need to meet tjIt is tiFraternal thing
That is engaged in is follow-up.Affairs t for belonging to TiAnd tj, tiIn tjSubmit before, tjTo affairs s write-in value val and in tjHold afterwards
Capable tiAffairs s value is read, then tiAnd tjThere is read-after-write conflict need to meet tjIt is tiFraternal affairs it is follow-up, i.e.,ti< tjAnd write (tj,s,val1)<write(ti, s, val2), then tiAnd tjThere is WAW conflicts need to expire
Sufficient tj∈descendants(sibling(ti))。ti< tjAnd read (tj,s)<write(ti, s, val),
Then tiAnd tjThere is WAR conflicts need to meet tj∈descendants(sibling(ti))。ti< tjAnd write
(tj,s,val)<read(ti, s, val2), then tiAnd tjThere is RAW conflicts need to meet tj∈descendants(sibling
(ti))。。
Common transaction in cross-thread and thread, due to using affairs serial sequenceization submit, effectively avoid affairs it
Between write after write and read-after-write rely on, therefore speculate nested software transaction storage system for common transaction in cross-thread and thread
Mainly detect that the writeafterread between affairs is relied on when affairs are submitted.Thread be nested with Transaction Information dependence solution be divided into it is following
Two kinds of situations:One be for read-after-write rely on, by using during read operation check versions of data be controlled, two be for writing after
Dependence is write after write and read, thus it is speculated that correlation change is first cached by the thread of execution, is rushed when speculating and performing and terminate and submit
Prominent detection.
2) collision detection is cleared up
Speculate that nested software transaction storage system is carried out using the random back Strategy of Conflict Resolution based on dynamic priority
Conflict resolution, wherein the priority original state of all affairs is all 0, affairs are excellent using dynamic priority algorithm care of transaction
First level.When affairs are clashed, compare the priority of affairs, stop the small affairs of priority.
The nested software transaction storage implementation procedure of supposition of the present invention is (start (read | write) * (submit | abandon)), affairs
Tx carries out a series of read-write operation on object set S, and affairs submit or run into conflict to stop affairs after the completion of performing, therefore
Affairs tx has three states:Activity, submit, abandon.
Speculating the conflict manager of nested software transaction storage system includes two groups of collision detector and conflict resolution device
Into part, its specific implementation is as follows:
1) collision detection
Speculate that nested software transaction storage system detects read-after-write conflict in read operation, write after write and reading are detected during submission
Write conflict afterwards.Fig. 2 is collision detector metadata structure.As shown in Fig. 2 each object has one to write version in collision detector
Number, the modification to the object every time can all cause to write version number's increase.Readset closes the affairs pointed to and there is read operation to the object,
Each transaction nodes include affairs ID, value and read version number, are needed when being operated every time to object according to actual implementation status
The value of version number is read in modification.Write set and point to the affairs that there is write operation to the object, each transaction write running node includes thing
Business ID, value, newly it be worth and write version number, it is necessary to update version number is write when affairs perform write operation, and is stored in and is newly worth.
1. detect that read-after-write conflict is relied on during read transaction
Fig. 4 is the read operation flow chart for speculating nested software transaction storage.As shown in figure 4, reading of the read operation from affairs tx
Reading object s is in the value of shared memory space in set, and the last of returning an object value s is write in the context of affairs tx and tx ancestors
Enter value, its read operation return value is divided into following three kinds of situations:
A. when affairs tx and its ancestors only have read operation to operation object s, if the readset that s is pertaining only to tx is closed, directly return
Return s value;
B. if s belongs to the readset conjunction of tx ancestors, the readset for merging modification tx is closed, and it is preceding the last to return to tx execution
Write-in value of the affairs that success is submitted to s;
C. the situation of affairs tx and its ancestors to s write operations.When s belongs to when writing set of tx, if s write operation thing
When business is tx, modification tx readset is closed, and returns to the value that there is write operation in tx to s;Otherwise tx is to carry out write operation to s
The brotgher of node of ancestors it is follow-up when there may be conflict, then call conflict manager.
In above-mentioned three kinds of situations, collision detection need not be all carried out in a, b, only needs to be conflicted in the case of c
Detection, i.e. affairs tx and its ancestors need to carry out collision detection to the situation of s write operations.When affairs tx and its ancestors write behaviour to s
When making, object s in collision detector is traveled through first writes set, searches and object s global write version number identical writes version
Affairs tx ' corresponding to number.If tx ' is exactly tx, modification tx readset is closed, and returns to the value that there is write operation in tx to s;
Otherwise tx be to s carry out write operation tx ' the brotgher of node it is follow-up when there may be conflict, then call conflict manager.
2. detection write after write and writeafterread conflict are relied on when affairs are submitted
When affairs tx is to s write operations, interim write-in val value, the modification s set of writing for writing version number and tx, and by tx
Relevant information be added to the writing in set of object s in collision detector.Write operation detects that the affairs do not have when affairs are submitted
Clash, modification is just visible to other affairs.
Fig. 5 is that the affairs for speculating nested software transaction storage submit operational flowchart.Affairs are submitted generally can in the presence of two kinds
Energy:One kind is not clashed with other affairs, then submits successfully, and affairs tx state is changed to from activity to submit;It is another
Planting is clashed with other affairs, then calls conflict manager, if abandoning tx, and tx state is changed to abandon from activity.
Detection write after write and writeafterread conflict when affairs are submitted.Affairs submit process as follows:
A. the submission order for submitting global variable serial whether to be less than affairs tx is judged, before tx is represented less than if
Also affairs, which are not completed, submits, it is necessary to wait.
B. all object s in the conjunction of affairs tx readsets are checked with the presence or absence of conflict, if during Lothrus apterus, by tx in subclass
Relevant information be incorporated to superset close in;If there is conflict, conflict resolution device is called to carry out conflict resolution.
C. check that affairs tx writes object s all in set, if in the absence of conflict, by s value and version number in affairs tx
The s in owner is copied to, and tx serial number is assigned to record to the VersionArray [s] of each colliding data version information;
If there is conflict, conflict resolution is called.
D. the readset for emptying affairs tx closes and writes set, changes tx state, and increases and submit global variable serial,
Affairs are submitted successfully.
Speculate that collision detection needs to travel through in collision detector respectively when the affairs of nested software transaction storage submit operation
Object s read-write set.When detecting writeafterread conflict, traverse object s reading set search and global write version number identical are read
Affairs tx corresponding to version number,.If tx, it is exactly the follow-up of the fraternal affairs of tx, then needs to call conflict manager to clear up conflict.Inspection
When surveying write after write conflict, traverse object s write set search and global write version number identical writes affairs corresponding to version number
Tx,.If tx, it is exactly the follow-up of the fraternal affairs of tx, then needs to call conflict manager to clear up conflict.
2) conflict resolution
Speculate that nested software transaction storage system is realized using the random back Strategy of Conflict Resolution based on dynamic priority
The priority original state of all affairs is all 0 in conflict resolution, the strategy, and affairs use dynamic priority algorithm care of transaction
Priority.When affairs are clashed, compare the priority of affairs, stop the small affairs of priority.The priority of root affairs=
Reading number of times+write number of times * 2+ timestamps.Priority=timestamp of subtransaction+father's affairs priority+reading number of times+writes number of times * 2.
Conflict resolution device is that each affairs creates a manager node, as shown in Figure 3.Each saved in conflict manager
Point includes priority, time started, number of attempt, termination number of times, father's affairs ID, father's affairs priority, reads number of times and write number of times.
Priority self-explanatory characters business tx priority, time started self-explanatory characters business tx timestamp, number of attempt, which refers to, attempts time for opening affairs tx
Number, stop number of times refer to due to other transactional conflict affairs tx suspended number of times, father's affairs ID self-explanatory characters business tx his father's affairs
No. ID, the priority of father's affairs priority self-explanatory characters business tx father's affairs reads the number of times that number of times self-explanatory characters business tx performs read operation, writes number of times
Self-explanatory characters' business tx performs the number of times of write operation.Conflict resolution step is as follows:
1. digestion device is initialized
Affairs tx is recorded respectivelyiAnd txjTimestamp, and initialize affairs txiAnd txjTermination number of times, read number of times and to write
Number of times, priority, father's affairs ID, father's affairs priority.
2. affairs are kept out of the way
If read operation opening or write operation open failure, allow affairs tx to avoid a period of time at random, and will attempt to beat
Open number of times and plus 1.If number of attempt is more than given threshold, stop affairs tx.
3. conflict resolution
The affairs tx clashedjIt is txiIn the presence of two kinds of situations.If affairs txjIt is txiDuring the descendant node of brother, then put
Abandon txj, and by txjIt is merged into txiFather node in, then terminate and destroy digestion device.If affairs txjIt is not txiAfter brother
When node, then tx is initializedi、txjAnd calculate its priority.By comparing the two priority, the small affairs of priority are abandoned,
And increase transaction abort number of times, then terminate and destroy digestion device.
If the affairs are that the descendant node or the affairs of another conflict transaction brother are more preferential than another affairs clashed
When level is low, the affairs compete failure, it is necessary to abandon, and otherwise clear up success.
Claims (9)
1. a kind of method for collision management for speculating nested software transaction storage, it is characterised in that comprise the following steps:
Step 1:Create affairs;
Step 2:Read operation or write operation are carried out to created affairs, if carrying out read operation, into step 3, if entering row write behaviour
Make, then into step 5;
Step 3:Read-after-write conflict is detected whether during read operation, if so, then entering step 4, if nothing, into step
5;
Step 4:Read-after-write conflict is cleared up during read operation, and judges whether conflict clears up, if so, then entering step
Rapid 5, if it is not, then entering step 9;
Step 5:Judge whether affairs terminate, if so, then entering step 6, if it is not, then returning to step 2;
Step 6:Affairs are submitted, and have detected whether write after write conflict or writeafterread conflict, if so, then enter step 7,
If nothing, into step 8;
Step 7:Write after write conflict or writeafterread conflict are cleared up during submission, and judge whether conflict clears up, if
It is, then into step 8;If it is not, then entering step 9;
Step 8:Affairs are submitted successfully;
Step 9:Abandon affairs;
Wherein, conflict has been detected whether by collision detector in step 3 and step 6, collision detector includes some objects, often
Individual object includes readset and closes, writes set and write version number, and the readset closes the affairs pointed to and there is read operation to the object, often
Individual transaction nodes include affairs ID, value and read version number, when affairs perform write operation, it is necessary to update the value for reading version number;Institute
State and write the affairs that set sensing has write operation to the object, each transaction write running node includes affairs ID, value, is newly worth and writes
Version number, version number is write when affairs perform write operation, it is necessary to update, and is stored in new value.
2. a kind of method for collision management for speculating nested software transaction storage according to claim 1, it is characterised in that step
Rapid 4 and step 7 in liquidated by conflict resolution device advance by leaps and bounds row clear up, conflict resolution device be each affairs create a manager section
Point, each manager node include priority, the time started, number of attempt, stop number of times, father's affairs ID, father's affairs priority,
Read number of times and write number of times.
3. a kind of method for collision management for speculating nested software transaction storage according to claim 2, it is characterised in that step
Read operation comprises the following steps in rapid 2:
Step 2.1:Object s is searched in set in writing for affairs tx and affairs tx ancestors, if not finding, into step 2.2, if
Find, then into step 2.4;
Step 2.2:Object s is searched in affairs tx readset is closed, if finding, direct returning an object value s value, if not finding,
Then enter step 2.3;
Step 2.3:Object s is searched in the readset of affairs tx ancestors is closed, object s and its reading version number are incorporated to affairs after finding
Tx readset is closed, and returns to write-in value of the last successful affairs submitted to object s before affairs are performed;
Step 2.4:Judge whether to the last write operation affairs of object s be exactly affairs tx, if so, object s value is write into version with it
This number readset for being incorporated to affairs tx is closed, and returns to the value that there is write operation in affairs tx to object s;If it is not, then entering step
2.5;
Step 2.5:Judge whether affairs tx and ancestors to object s write operations are the brotgher of node, if so, then there is read-after-write punching
It is prominent, and the row of advancing by leaps and bounds of liquidating clears up, if it is not, by object s value and its write version number and be incorporated to affairs tx readset and close, and return to affairs
There is the value of write operation in tx to object s.
4. a kind of method for collision management for speculating nested software transaction storage according to claim 2, it is characterised in that step
Affairs are submitted and comprised the following steps in rapid 6:
Step 6.1:Judge to submit whether global sequence number serial is less than affairs tx submission serial number, if so, then wait, if
It is no, then into step 6.2;
Step 6.2:Check that all object s whether there is writeafterread conflict in the conjunction of affairs tx readsets, if in the presence of liquidate row of advancing by leaps and bounds
Clear up and enter step 6.5, if being not present, the relevant information of affairs in subclass is incorporated to during superset is closed and enters step
6.3;
Step 6.3:Check that affairs tx writes all object s in set and whether there is write after write conflict, if in the presence of liquidate row of advancing by leaps and bounds
Clear up and enter step 6.5, if being not present, object s value and version number in affairs tx, which are copied to, to write in set has to object s
Carry out the affairs of operation and enter step 6.4;
Step 6.4:The readset for emptying affairs tx closes and writes set, and global sequence number serial plus 1, subsequently into step
6.5;
Step 6.5:Terminate.
5. a kind of method for collision management for speculating nested software transaction storage according to claim 4, it is characterised in that step
Check that all object s are with the presence or absence of the method for writeafterread conflict in the conjunction of affairs tx readsets in rapid 6.2:Traverse object s readset
The affairs tx ' searched with corresponding to identical reading version number of global write version number is closed, if affairs tx ' is exactly affairs tx fraternal thing
That is engaged in is follow-up, then there is writeafterread conflict.
6. a kind of method for collision management for speculating nested software transaction storage according to claim 4, it is characterised in that step
Check that affairs tx writes all object s in set and is with the presence or absence of the method for write after write conflict in rapid 6.3:Traverse object s's writes collection
Conjunction lookup and global write version number identical write the affairs tx ' corresponding to version number, if affairs tx ' is exactly affairs tx fraternal thing
That is engaged in is follow-up, then there is write after write conflict.
7. a kind of method for collision management for speculating nested software transaction storage according to claim 4, it is characterised in that punching
The prominent method cleared up is:The priority original state of all affairs is set to 0, when affairs are clashed, compares affairs
Priority, stop the small affairs of priority, the priority of root affairs=reading number of times+writes number of times * 2+ timestamps, subtransaction it is excellent
First level=timestamp+father's affairs priority+reading number of times+writes number of times * 2.
8. a kind of method for collision management for speculating nested software transaction storage according to claim 7, it is characterised in that punching
It is prominent clear up comprise the following steps that:
1) conflict resolution device is initialized:Affairs tx is recorded respectivelyiAnd txjTimestamp, and initialize affairs txiAnd txjTermination
Number of times, read number of times, write number of times, priority, father's affairs ID and father's affairs priority;
2) affairs are kept out of the way:If read operation opening or write operation open failure, allow affairs to avoid at random, and will attempt to open secondary
Number Jia 1, if number of attempt is more than given threshold, stops affairs;
3) conflict resolution:If affairs txjIt is txiDuring the descendant node of brother, then tx is abandonedj, and by txjIt is merged into txiFather section
In point, then terminate and destroy conflict resolution device;If affairs txjIt is not txiDuring the descendant node of brother, then tx is initializediWith
txjAnd its priority is calculated, by comparing the two priority, the small affairs of priority are abandoned, and increase transaction abort number of times, so
After terminate and destroy conflict resolution device.
9. a kind of method for collision management for speculating nested software transaction storage according to claim 8, it is characterised in that sentence
The disconnected situation about whether clearing up that conflicts has following two:One, in two affairs clashed, if an affairs are another affairs
Descendant node then transaction retraction rollback of brother, the conflict resolution if revocation rollback success, otherwise conflicts and does not clear up;Two, if
One affairs is then cancelled and the low thing of priority in two conflict transactions of rollback when not being the descendant node of another affairs brother
Business, the conflict resolution if revocation rollback success, does not otherwise clear up.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510346790.3A CN105045563B (en) | 2015-06-19 | 2015-06-19 | A kind of method for collision management for speculating nested software transaction storage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510346790.3A CN105045563B (en) | 2015-06-19 | 2015-06-19 | A kind of method for collision management for speculating nested software transaction storage |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105045563A CN105045563A (en) | 2015-11-11 |
CN105045563B true CN105045563B (en) | 2017-10-10 |
Family
ID=54452129
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510346790.3A Active CN105045563B (en) | 2015-06-19 | 2015-06-19 | A kind of method for collision management for speculating nested software transaction storage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105045563B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107533474B (en) * | 2016-01-26 | 2020-07-07 | 华为技术有限公司 | Transaction processing method and device |
EP3877859A4 (en) * | 2018-12-11 | 2022-01-05 | Huawei Technologies Co., Ltd. | Write-write conflict detection for multi-master shared storage database |
CN110347400B (en) * | 2019-06-13 | 2023-03-14 | 西安科技大学 | Compile acceleration method, routing unit and cache |
CN114510327B (en) * | 2022-01-07 | 2023-12-22 | 中汽创智科技有限公司 | Dynamic priority adjustment method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101326494A (en) * | 2005-12-15 | 2008-12-17 | 英特尔公司 | Coordinating access to memory locations for hardware transactional memory transactions and software transactional memory transactions |
US7536517B2 (en) * | 2005-07-29 | 2009-05-19 | Microsoft Corporation | Direct-update software transactional memory |
CN101535950A (en) * | 2006-11-17 | 2009-09-16 | 微软公司 | Software transaction commit order and conflict management |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8060482B2 (en) * | 2006-12-28 | 2011-11-15 | Intel Corporation | Efficient and consistent software transactional memory |
US8719828B2 (en) * | 2011-10-14 | 2014-05-06 | Intel Corporation | Method, apparatus, and system for adaptive thread scheduling in transactional memory systems |
-
2015
- 2015-06-19 CN CN201510346790.3A patent/CN105045563B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7536517B2 (en) * | 2005-07-29 | 2009-05-19 | Microsoft Corporation | Direct-update software transactional memory |
CN101326494A (en) * | 2005-12-15 | 2008-12-17 | 英特尔公司 | Coordinating access to memory locations for hardware transactional memory transactions and software transactional memory transactions |
CN101535950A (en) * | 2006-11-17 | 2009-09-16 | 微软公司 | Software transaction commit order and conflict management |
Non-Patent Citations (1)
Title |
---|
面向多核结构的软件事务存储系统冲突管理技术研究与实现;魏广博;《中国优秀硕士位论文全文数据库信息科技辑》;20120215;第8-39页 * |
Also Published As
Publication number | Publication date |
---|---|
CN105045563A (en) | 2015-11-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9569254B2 (en) | Automatic checkpointing and partial rollback in software transaction memory | |
EP3278239B1 (en) | Processing database transactions in a distributed computing system | |
US8464261B2 (en) | System and method for executing a transaction using parallel co-transactions | |
US8661449B2 (en) | Transactional computation on clusters | |
US8407386B2 (en) | Increasing functionality of a reader-writer lock | |
US9727369B2 (en) | System and method for implementing reader-writer locks using hardware transactional memory | |
US7676638B2 (en) | Combined pessimistic and optimistic concurrency control | |
Calciu et al. | Improved single global lock fallback for best-effort hardware transactional memory | |
CN105045563B (en) | A kind of method for collision management for speculating nested software transaction storage | |
US8239635B2 (en) | System and method for performing visible and semi-visible read operations in a software transactional memory | |
US8176022B1 (en) | Locking protocol using dynamic locks and dynamic shared memory | |
US8103838B2 (en) | System and method for transactional locking using reader-lists | |
US20140040208A1 (en) | Early release of transaction locks based on tags | |
CN101510162B (en) | Software transaction internal memory implementing method based on delaying policy | |
JP2017509083A (en) | Lock Elegance with Binary Transaction Based Processor | |
CN102929711B (en) | A kind of implementation method of real-time transactional memory of software | |
Hassan et al. | On developing optimistic transactional lazy set | |
US10671427B2 (en) | Snapshot isolation in graphical processing unit hardware transactional memory | |
CN111858503B (en) | Parallel execution method and data synchronization system based on log analysis synchronization | |
CN111858504B (en) | Operation merging execution method based on log analysis synchronization and data synchronization system | |
CN111930692B (en) | Transaction merging execution method and device based on log analysis synchronization | |
CN112035222B (en) | Transaction operation merging execution method and device based on log analysis synchronization | |
CN114296886A (en) | Parallel execution method and device based on range row lock | |
US20160292203A1 (en) | Process control method for database, medium, and database server | |
Alhajri et al. | OCC2T: An Early-Read Dual-Track OCC Algorithm For Mixed Mode Systems |
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 |