CN100517238C - Method for accomplishing multi-instance and thread serialized affair processing - Google Patents

Method for accomplishing multi-instance and thread serialized affair processing Download PDF

Info

Publication number
CN100517238C
CN100517238C CNB2007100005039A CN200710000503A CN100517238C CN 100517238 C CN100517238 C CN 100517238C CN B2007100005039 A CNB2007100005039 A CN B2007100005039A CN 200710000503 A CN200710000503 A CN 200710000503A CN 100517238 C CN100517238 C CN 100517238C
Authority
CN
China
Prior art keywords
serializing
thread
instance
message
affairs
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
CNB2007100005039A
Other languages
Chinese (zh)
Other versions
CN101216779A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CNB2007100005039A priority Critical patent/CN100517238C/en
Publication of CN101216779A publication Critical patent/CN101216779A/en
Application granted granted Critical
Publication of CN100517238C publication Critical patent/CN100517238C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method for realizing multiple-instance thread serializing transaction processing. The method includes the following steps: in step S302, an operation thread initiates serializing transaction to multiple-instance operation thread sort, wherein the serializing transaction comprises multiple sequential messages; in step S304, the operation thread sets a serializing transaction ID number and a serializing transaction status flag in the multiple messages; in step S 306, a substitutional function of the multiple-instance operation thread sort detects the serializing transaction status flag, and acts the relative operation in a serializing transaction mapping table according to the detected serializing transaction status flag. By adopting the technical proposal, the invention has the following advantages that: the parallel running advantage of the multiple-instance thread is applied, the scheduling utility ratio of the operating system is improved, and the scrambled process for the serializing transaction is not occurred, thereby ensuring the accurate realization of the operation.

Description

Realize the method for multi-instance and thread serializing issued transaction
Technical field
The present invention relates to operating system, parallel processing, business support field, and more particularly, relate to the method that realizes multi-instance and thread serializing issued transaction under a kind of SMP (Symmetric MultiProcessor, symmetric multiprocessor) architectural framework.
Background technology
In the SMP architectural framework,, often need to handle the heavier key business flow process multiple example type of load in order to make full use of the advantage that multi-core parallel concurrent is handled as far as possible.But behind the thread multiple example type, can cause many problems again, this need go to solve one by one, and wherein, how the serializing issued transaction realizes being exactly a problem demanding prompt solution behind the many examples of thread.
In software systems, some thread (for example thread A) sends message to other thread (for example thread B) usually, finishes some function to trigger B.As shown in Figure 1, some business may comprise a series of processing, and these processing should keep serializing, can not be out of order, otherwise will cause service fail.In the monokaryon system, a kind of business generally all is to be finished by a thread, therefore, thread A can send a series of message to thread B continuously, and can guaranteeing serial, thread B handles these message in an orderly manner, thereby finish this business, so the serializing issued transaction does not have problems generally in the monokaryon system.If multi-computer system, as a plurality of node associated treatment business on network, owing to multipath transmisstion message may occur, the communication node processing messages is out-of-sequence perhaps, therefore just need add acknowledgement mechanism end to end, sequence number adds technology such as buffer memory, with the orderly processing of assurance serializing affairs.
And in multi-core system, as shown in Figure 2, some professional can processing by multi-instance and thread.Suppose that thread B by multiple example type, then is referred to as the B of multi-instance and thread family.At this moment thread A initiates a business, and its subsequent treatment needs thread B to finish.Therefore thread A has sent a series of message to the B of multi-instance and thread family, these message are distributed to B1...Bn on a plurality of examples of the B of thread family, and these thread examples may be operated system call to upward parallel running of different CPU, therefore also just the out-of-sequence of Message Processing may occur, cause professional failure.If on multi-core system, adopt acknowledgement mechanism, then efficient is very low, adopt traditional sequence number to add the advantage that in fact caching technology then can't use the multi-instance and thread parallel running, allow a lot of out-of-sequence multi-instance and threads dally on the contrary, cause the scheduling waste of operating system.
Therefore, there is the problem of the out-of-sequence service fail that causes of Message Processing at present in the technical scheme that adopts, in addition, also has the problem of operating system scheduling waste.
Summary of the invention
Fundamental purpose of the present invention is to provide the mechanism that realizes multi-instance and thread serializing issued transaction under a kind of SMP architectural framework.
To achieve these goals, according to embodiments of the invention, provide a kind of method that realizes multi-instance and thread serializing issued transaction.
This method may further comprise the steps: first step, and professional thread is initiated the serializing affairs to the professional thread of many examples family, and wherein, the serializing affairs comprise orderly a plurality of message; Second step, professional thread are provided with serializing affairs ID number and serializing transaction status sign on a plurality of message; And third step, the proxy function of the professional thread of many examples family detects serializing transaction status sign, and carries out the associative operation of serializing affairs mapping table according to the serializing transaction status sign that is detected.
The value of wherein, serializing transaction status sign comprises: beginning, continuation, end, invalid; In the third step, the associative operation of serializing affairs mapping table comprises: create serializing affairs mapping table, search serializing affairs mapping table, delete serializing affairs map record.。
Particularly, in second step, during first message in sending a plurality of message of professional thread, serializing transaction status sign is set to beginning; During end message in sending a plurality of message, serializing transaction status sign is set to finish; During other message in sending a plurality of message, serializing transaction status sign is set to continue.
Correspondingly, in third step, when the proxy function of multi-instance and thread family receives first message, detect the serializing transaction status and be masked as beginning, according to load-balancing algorithm, distribute to certain multi-instance and thread and handle, and first message is sent to this multi-instance and thread, in serializing affairs mapping table, set up a map record according to numbering, the processing multi-instance and thread numbering of serializing affairs ID number, professional thread simultaneously.When the proxy function of multi-instance and thread family receives other message, detect the serializing transaction status and be masked as continuation, numbering according to serializing affairs ID number and professional thread is searched serializing affairs mapping table, find the multi-instance and thread numbering of handling last time, and other message is sent to this multi-instance and thread.When the proxy function of multi-instance and thread family receives end message, detect the serializing transaction status and be masked as end, search serializing affairs mapping table, find multi-instance and thread, and this message sent to the multi-instance and thread that inquires, the map record of these serializing affairs of deletion from serializing affairs mapping table then.
In addition, this method may further include following steps: the 4th step, and drive thread is initiated non-serializing affairs to multi-instance and thread family, and wherein, non-serializing affairs comprise unordered a plurality of message; The 5th step, drive thread is set to default value ID number with the serializing affairs of a plurality of message, and serializing transaction status sign be set to invalid; The 6th step, the proxy function of multi-instance and thread family detect serializing transaction status sign, and distribute the processing threads of each message in a plurality of message according to load-balancing algorithm.
Pass through technique scheme, the present invention has realized following beneficial effect: the advantage of having used the multi-instance and thread parallel running, improved the scheduling utilization factor of operating system, and out of order processing that can the occurrence sequence affairs, thereby professional correct realization guaranteed.
Description of drawings
Accompanying drawing described herein is used to provide further understanding of the present invention, constitutes the application's a part, and illustrative examples of the present invention and explanation thereof are used to explain the present invention, do not constitute improper qualification of the present invention.In the accompanying drawings:
Fig. 1 is in the conventional single-core system, and professional thread A initiates the synoptic diagram of a serializing issued transaction to professional thread B;
Fig. 2 is in the multi-core system, and when not using the inventive method, professional thread A initiates the synoptic diagram that out-of-sequence situation takes place a serializing issued transaction to the B of multi-instance and thread family;
Fig. 3 is the process flow diagram that illustrates according to the method for the realization multi-instance and thread serializing issued transaction of first embodiment of the invention;
Fig. 4 is in the multi-core system, and when using the inventive method, professional thread A, professional thread B send the serializing transaction message to the C of multi-instance and thread family, and professional thread H has sent the synoptic diagram of non-serializing transaction message to the C of multi-instance and thread family simultaneously; And
Fig. 5 is the synoptic diagram that illustrates according to serializing affairs mapping table of the present invention.
Embodiment
At first, brief description principle of the present invention.The present invention utilizes multi-instance and thread family (promptly, by multiple example type thread) notion, adopt the mode of multi-instance and thread family's main thread or proxy function to isolate the multiple example type specific implementation, when other threads need this multi-instance and thread family to finish the serializing issued transaction, in sending message, be with serializing affairs ID numbering and serializing transaction status sign, and multi-instance and thread family main thread or proxy function will be set up a serializing affairs mapping table record for these serializing affairs ID, guarantee that the subsequent sequence transaction message all sends to same multi-instance and thread and handles, realize the serializing issued transaction with this.
Multi-instance and thread family can realize by multi-instance and thread family main thread or proxy function dual mode, because the main thread mode can be brought more scheduling overhead and may become new serial bottleneck, therefore the embodiment of the invention mainly uses proxy function to realize, for convenience of explanation, all describe among the embodiment that hereinafter provides with proxy function.
Relate generally to communication function and multi-instance and thread family proxy function in the embodiment of the invention.Wherein, communication function: need to increase serializing affairs ID numbering and serializing transaction status sign; Multi-instance and thread family proxy function: in its treatment scheme, increase the operation of identification of serializing transaction flag and serializing affairs mapping table, and improve the distribution method of many instance processes thread.
Describe the preferred embodiments of the present invention in detail hereinafter with reference to accompanying drawing.
First embodiment
In the present embodiment, provide a kind of method that realizes multi-instance and thread serializing issued transaction.As shown in Figure 3, this method may further comprise the steps: step S302, and professional thread is initiated the serializing affairs to the professional thread of many examples family, and wherein, the serializing affairs comprise orderly a plurality of message; Step S304, professional thread are provided with serializing affairs ID number and serializing transaction status sign on a plurality of message; Step S306, the proxy function of the professional thread of many examples family detects serializing transaction status sign, and carries out the associative operation of serializing affairs mapping table according to the serializing transaction status sign that is detected.
Wherein, in step S304, the serializing affairs can be for ID number total system overall situation numberings, also can be by each process or thread independent numbering, and each comprises a series ofly has the affairs of the processing that sequential requires to have a serializing affairs ID.Serializing transaction status sign span is beginning, continuation, end, invalid.
In addition, in step S306, the associative operation of serializing affairs mapping table comprises: create serializing affairs mapping table, search serializing affairs mapping table, delete serializing affairs map record.。
In step S304, during first message in sending a plurality of message of professional thread, serializing transaction status sign is set to beginning (that is, expression notice multi-instance and thread family proxy function, serializing affairs have begun); During end message in sending a plurality of message, serializing transaction status sign is set to finish; During other message in sending a plurality of message, serializing transaction status sign is set to continue.
Correspondingly, in step S306, when the proxy function of multi-instance and thread family receives first message, detect the serializing transaction status and be masked as beginning, according to load-balancing algorithm, distribute to multi-instance and thread and handle, and first message is sent to this multi-instance and thread, in serializing affairs mapping table, set up a map record according to numbering, the processing multi-instance and thread numbering of serializing affairs ID number, professional thread simultaneously.In addition, serializing affairs mapping table is created by multi-instance and thread family, and wherein, serializing affairs mapping table comprises: the numbering of serializing affairs ID number, professional thread and the numbering of multi-instance and thread.Wherein, Fig. 5 shows above-mentioned serializing affairs mapping table.
In addition, in step S306, when the proxy function of multi-instance and thread family receives other message, detect the serializing transaction status and be masked as continuation, numbering according to serializing affairs ID number and professional thread is searched serializing affairs mapping table, find the multi-instance and thread numbering of handling last time, and other message is sent to this multi-instance and thread; When the proxy function of multi-instance and thread family receives end message, detect the serializing transaction status and be masked as end, search serializing affairs mapping table, find multi-instance and thread, and this message sent to the multi-instance and thread that finds, the map record of these serializing affairs of deletion from serializing affairs mapping table then.
In addition, when multi-instance and thread family sent non-serializing transaction message, this method further may further comprise the steps as professional thread:
Step S308, drive thread is initiated non-serializing affairs to multi-instance and thread family, and wherein, non-serializing affairs comprise unordered a plurality of message; Step S310, drive thread is set to default value ID number with the serializing affairs of a plurality of message, and serializing transaction status sign be set to invalid; Step S312, the proxy function of multi-instance and thread family detects serializing transaction status sign, and distributes the processing threads of each message in a plurality of message according to load-balancing algorithm.
It should be noted that above-mentioned step only is exemplary, purpose only is to be convenient to illustrate and provide thorough of the present invention that processing mode of the present invention is not limited thereto, but can carry out various changes according to need of practice.
The method that provides in the present embodiment is described below with reference to instantiation.
As shown in Figure 4, at first, professional thread A initiates serializing affairs to the professional thread C of family of many examples, comprises orderly A, B, C, D message.Professional thread A is that these serializing affairs are distributed an ID:101, when sending first message A, serializing transaction status sign is changed to beginning.When sending B, C message, serializing transaction status sign is changed to continuation, when sending D message, serializing transaction status sign is changed to end.These message all send to the C of multi-instance and thread family.
The proxy function of the C of multi-instance and thread family is with the serializing transaction status sign in the detect-message: when receiving message A, its value of statistical indicant is beginning, then according to load-balancing algorithm, distribute a multi-instance and thread C1 to handle, this message is sent to the thread C1 of this distribution, use these serializing affairs ID numbers 101 simultaneously, send message threads A, receive message multi-instance and thread C1, create a map record (as shown in Figure 5); When the proxy function of the C of multi-instance and thread family is received message B, detect its value of statistical indicant for continuing, then no longer distribute multi-instance and thread according to load-balancing algorithm, but remove to search serializing affairs mapping table according to sending thread number A, serializing affairs ID numbers 101, the many instance processes thread C1 that distributes before finding sends to same thread C1 with this message and handles; When the proxy function of the C of multi-instance and thread family was received message C, processing mode was the same; When the proxy function of the C of multi-instance and thread family is received message D, detect its value of statistical indicant, then continue to search mapping table, this message is sent to same thread C1 handle, then this record of deletion from serializing affairs mapping table for finishing.
The serializing transaction message processing mode that professional thread B sends to professional thread C is the same.
Drive thread H sends to non-serializing transaction message O, P, Q, the R of the C of multi-instance and thread family, will be not can assigned sequence affairs ID, default value is 0, it is invalid that the serializing transaction status is masked as.The proxy function of the C of multi-instance and thread family will be distributed the processing threads of each message according to load-balancing algorithm after detecting this sign, and these message will obtain parallel processing.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (9)

1. a method that realizes multi-instance and thread serializing issued transaction is characterized in that, may further comprise the steps:
First step, professional thread is initiated the serializing affairs to the professional thread of many examples family, and wherein, described serializing affairs comprise orderly a plurality of message;
Second step, described professional thread are provided with serializing affairs ID number and serializing transaction status sign on described a plurality of message; And
Third step, the proxy function of the professional thread of described many examples family detects described serializing transaction status sign, and carries out the associative operation of serializing affairs mapping table according to the serializing transaction status sign that is detected.
2. method according to claim 1 is characterized in that, the value of described serializing transaction status sign comprises: beginning, continuation, end, invalid.
3. according to the described method of claim 2, it is characterized in that in described third step, the associative operation of described serializing affairs mapping table comprises: create serializing affairs mapping table, search serializing affairs mapping table, delete serializing affairs mapping table record.
4. method according to claim 3 is characterized in that, in described second step, during first message in sending described a plurality of message of described professional thread, described serializing transaction status sign is set to beginning; During end message in sending described a plurality of message, described serializing transaction status sign is set to finish; During other message in sending described a plurality of message, described serializing transaction status sign is set to continue.
5. method according to claim 4, it is characterized in that, in described third step, when the described proxy function of described multi-instance and thread family receives described first message, detect described serializing transaction status and be masked as beginning, according to load-balancing algorithm, distribute multi-instance and thread, and described first message is sent to described multi-instance and thread.
6. method according to claim 5, it is characterized in that, serializing affairs mapping table is created by described multi-instance and thread family, and wherein, described serializing affairs mapping table comprises: the numbering of described serializing affairs ID number, described professional thread and the numbering of described multi-instance and thread.
7. method according to claim 4, it is characterized in that, when the proxy function of described multi-instance and thread family receives described other message, detect described serializing transaction status and be masked as continuation, numbering according to described serializing affairs ID number and described professional thread is searched described serializing affairs mapping table, find described multi-instance and thread, and described other message is sent to described multi-instance and thread.
8. method according to claim 4, it is characterized in that, when the proxy function of described multi-instance and thread family receives described end message, detect described serializing transaction status and be masked as end, search described serializing affairs mapping table, find described multi-instance and thread, and described end message is sent to described multi-instance and thread, then the map record of the described serializing affairs of deletion from described serializing affairs mapping table.
9. method according to claim 1 is characterized in that, further may further comprise the steps:
The 4th step, drive thread is initiated non-serializing affairs to multi-instance and thread family, and wherein, described non-serializing affairs comprise unordered a plurality of message;
The 5th step, described drive thread is set to default value ID number with the serializing affairs of described a plurality of message, and serializing transaction status sign be set to invalid;
The 6th step, the proxy function of described multi-instance and thread family detects described serializing transaction status sign, and distributes the processing threads of each message in described a plurality of message according to load-balancing algorithm.
CNB2007100005039A 2007-01-05 2007-01-05 Method for accomplishing multi-instance and thread serialized affair processing Expired - Fee Related CN100517238C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2007100005039A CN100517238C (en) 2007-01-05 2007-01-05 Method for accomplishing multi-instance and thread serialized affair processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2007100005039A CN100517238C (en) 2007-01-05 2007-01-05 Method for accomplishing multi-instance and thread serialized affair processing

Publications (2)

Publication Number Publication Date
CN101216779A CN101216779A (en) 2008-07-09
CN100517238C true CN100517238C (en) 2009-07-22

Family

ID=39623218

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2007100005039A Expired - Fee Related CN100517238C (en) 2007-01-05 2007-01-05 Method for accomplishing multi-instance and thread serialized affair processing

Country Status (1)

Country Link
CN (1) CN100517238C (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103020203B (en) * 2012-12-05 2017-04-12 北京奇虎科技有限公司 Method and device for processing data
CN104506440B (en) * 2014-12-26 2017-12-26 成都致云科技有限公司 The data packet sending method and routing table amending method of router
CN110262848B (en) * 2019-06-05 2022-03-04 创新先进技术有限公司 Method and device for loading application program instance in application development framework
CN110457116B (en) * 2019-07-22 2023-10-27 创新先进技术有限公司 Method and device for processing transaction request
CN112835687B (en) * 2021-01-22 2023-05-26 恒生电子股份有限公司 Method and system for processing computer transaction

Also Published As

Publication number Publication date
CN101216779A (en) 2008-07-09

Similar Documents

Publication Publication Date Title
US7246167B2 (en) Communication multiplexor using listener process to detect newly active client connections and passes to dispatcher processes for handling the connections
US8270299B2 (en) Communicator-based token/buffer management for eager protocol support in collective communication operations
US8006005B2 (en) Centralized polling service
CN100517238C (en) Method for accomplishing multi-instance and thread serialized affair processing
CN100488265C (en) Concurrent method for treating calling events
US6158006A (en) Method for the coordination of parallel accesses of a plurality of processors to resource configurations
CN110058940B (en) Data processing method and device in multi-thread environment
US8792498B2 (en) System and method for enhanced updating layer-2 bridge address table on asymmetric multiprocessing systems
CN107181789A (en) A kind of distributed lock implementation method and device
CN108063813B (en) Method and system for parallelizing password service network in cluster environment
US7707181B2 (en) System and method of distributing replication commands
US10860378B2 (en) System and method for association aware executor service in a distributed computing environment
US20020147785A1 (en) Efficient connection and memory management for message passing on a single SMP or a cluster of SMPs
CN108415757A (en) distributed transaction processing method and device
CN105579963B (en) Task Processing Unit, electronic equipment and method
CN110569312A (en) big data rapid retrieval system based on GPU and use method thereof
CN101216780B (en) Method and apparatus for accomplishing multi-instance and thread communication under SMP system
US20060156312A1 (en) Method and apparatus for managing an event processing system
Fei et al. FlexNFV: Flexible network service chaining with dynamic scaling
US8051417B2 (en) Target thread selection in a multi-threaded process
KR19990043986A (en) Business take over system
EP1891525A2 (en) Techniques for handling lock-related inconsistencies
Vardoulakis et al. Tebis: index shipping for efficient replication in lsm key-value stores
Zhang et al. PVM: Parallel View Maintenance under Concurrent Data Updates of Distributed Sources⋆
JP5707409B2 (en) calculator

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090722

Termination date: 20180105