CN102325091A - Memory release method and routing system - Google Patents

Memory release method and routing system Download PDF

Info

Publication number
CN102325091A
CN102325091A CN201110314529A CN201110314529A CN102325091A CN 102325091 A CN102325091 A CN 102325091A CN 201110314529 A CN201110314529 A CN 201110314529A CN 201110314529 A CN201110314529 A CN 201110314529A CN 102325091 A CN102325091 A CN 102325091A
Authority
CN
China
Prior art keywords
resource
nuclear
forwarding
discharge
needs
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.)
Granted
Application number
CN201110314529A
Other languages
Chinese (zh)
Other versions
CN102325091B (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.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication Technology Co Ltd
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 Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN201110314529.7A priority Critical patent/CN102325091B/en
Publication of CN102325091A publication Critical patent/CN102325091A/en
Application granted granted Critical
Publication of CN102325091B publication Critical patent/CN102325091B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a memory release method and a routing system. The method comprises that: all forwarding cores in the routing system are sequentially organized according to set rules; after updating resources pointed by a resource pointer, each forwarding core stores the resources pointed by the resource pointer before the updating into a resource release queue allocated to the next forwarding core as resources to be released; and each forwarding core checks whether own allocated resource release queue comprises the resources to be released, sequentially takes each resource to be released out and judges whether the resources are the resources, determined by updating the resources pointed by the resource pointer, to be released if own allocated resource release queue comprises the resources to be released, releases the resources if the resources are the resources, determined by updating the resources pointed by the resource pointer, to be released, otherwise continues storing the resources into the resource release queue allocated to the next forwarding core as the resources to be released.

Description

Internal memory method for releasing and route system
Technical field
The present invention relates to data communication technology, particularly internal memory method for releasing and route system.
Background technology
Along with the continuous lifting of physical interface speed, the forwarding of CPU nuclear (core) number also increases thereupon in the route system.In route system, each of CPU transmitted nuclear and transmitted through concurrent working mode parallel processing message, in the hope of improving message forwarding performance.But, when a plurality of forwarding nuclears are visited identical code district (being designated as shared resource) simultaneously,, need a plurality of forwardings of realization to check the exclusive reference of shared resource for avoiding conflict, this exclusive reference can not embody the advantage that multi-core parallel concurrent is carried out.
In order to embody the advantage that multi-core parallel concurrent is carried out, just need avoid the exclusive reference of shared resource.Prior art provides following method to replace the exclusive reference of shared resource: through the visit of resource pointer control shared resource.Can be in the time of should specifically realizing through the visit of resource pointer control shared resource: when reading shared resource,, can directly visit through the resource pointer without mutual exclusion; And when writing shared resource also without mutual exclusion, promptly at first copy a shared resource, on the shared resource of copy, carry out write operation then, new resources pointer more after write operation is accomplished lets it point to the shared resource of new copy.
As for original shared resource, it needs to discharge.Wherein, this release resource is based on the delay memory method for releasing of time, promptly counts from the time point of above-mentioned more new resources pointer, after postponing a period of time, discharges original shared resource.The time of this delay is static appointment, like 1 second or 10 seconds etc.
But; This time-based delay memory method for releasing is a poor efficiency or even insecure; Because the time that postpones is static appointment, if the time of delay of appointment is too short, so when arrive in this time of delay; Also can exist this resource to be discharged to also have the possibility of being visited, this influences resource access; If the time of delay of appointment is long, will certainly in a period of time, reduce the quantity of the available free memory of system so, cause the waste of resource.
Summary of the invention
The invention provides internal memory method for releasing and route system, with the poor efficiency of avoiding time-based delay memory method for releasing to be brought, even not reliable defective.
Technical scheme provided by the invention comprises:
A kind of internal memory method for releasing comprises:
All forwarding nuclears in the route system are organized according to the rule of setting successively;
Each transmits nuclear after the resource of new resources pointed more, and the resource that this resource pointer was pointed to before upgrading is as the resource that needs discharge, and deposits to transmit the resource that nuclear is assigned with to the next one and discharge in the formation;
The resource that each forwarding nuclear inspection self is assigned with discharges the resource whether formation exists needs to discharge; If then take out the resource that each need discharge successively, and judge that whether this resource is because self more resource and resource that definite needs discharge of new resources pointed; If; Then discharge this resource, otherwise, this resource is continued to deposit the resource that is assigned with to next one forwarding nuclear as the resource that needs discharge discharge in the formation.
A kind of route system comprises: OU, dispensing unit and a plurality of forwarding nuclear, wherein,
Said OU is used for all forwarding nuclears of route system are organized according to the rule of setting;
Said dispensing unit is used to each and transmits nuclear distributing independent resource release formation;
Each is transmitted nuclear and comprises: first processing unit and second processing unit, wherein,
Said first processing unit; Be used for after the resource of new resources pointed is more examined in its residing forwarding; The resource that this resource pointer was pointed to before upgrading is as the resource that needs discharge, and deposits to the next one of this forwardings nuclear and transmits in the resource release formation that nuclear is assigned with;
Said second processing unit; Be used to check that the resource that its residing forwarding nuclear is assigned with discharges the resource whether formation exists needs to discharge; If then take out the resource that each need discharge successively, and judge that whether this resource is the resource that definite needs discharge because the resource of new resources pointed is more examined in its residing forwarding; If; Then discharge this resource, otherwise, this resource is continued to deposit the resource that is assigned with to the next one forwarding nuclear of this forwarding nuclear as the resource that needs discharge discharge in the formation.
Can find out by above technical scheme; Among the present invention; Each transmit nuclear at it because the resource of new resources pointed and resource that definite needs discharge just discharges this resource after transmitting nuclear through all is more promptly transmitted at all just in time to discharge this resource when nuclear is not visited this resource, this one side can not influence resource access; Also can in time discharge resource on the other hand; Can not cause the waste of resource, poor efficiency, the even reliable defective of avoiding time-based delay memory method for releasing to be brought, poor efficiency, the even reliable defective of having avoided time-based delay memory method for releasing to be brought fully.
Description of drawings
The basic flow sheet that Fig. 1 provides for the embodiment of the invention;
The ring structure sketch map that Fig. 2 provides for the embodiment of the invention;
Another sketch map of ring structure that Fig. 3 provides for the embodiment of the invention;
The route system structure chart that Fig. 4 provides for the embodiment of the invention.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer, describe the present invention below in conjunction with accompanying drawing and specific embodiment.
Referring to Fig. 1, the basic flow sheet that Fig. 1 provides for the embodiment of the invention.As shown in Figure 1, this flow process can may further comprise the steps:
Step 101 is organized according to the rule of setting all the forwarding nuclears in the route system successively.
Can be during this step 101 concrete realizations all forwarding nuclear is formed a ring successively according to the order of setting.
Wherein, all forwarding nuclears are formed a ring successively according to the order of setting specifically can be: all the forwarding nuclears in the route system are numbered in order, if all in the route system are transmitted nuclear are: core-1; Core-2; ... core-N, then can all transmit nuclear numbering in order to this since a predefined initial value such as 1, such as; Be numbered from 1 to N, afterwards all transmitted nuclear and form a ring successively according to the numbering size.Wherein, all forwarding nuclears are formed a ring successively according to the numbering size and can comprise following arbitrary situation:
Situation 1: clockwise all are transmitted nuclear according to the ascending order of the numbering of transmitting nuclear and form a ring.All forwarding nuclears with in the route system are core-1, core-2 ... core-N, what this each forwarding was examined is numbered 1,2 ... N, based on this, clockwise can be as shown in Figure 2 according to the order that numbering is ascending with ring of all forwarding nuclear compositions.
Situation 2: clockwise all are transmitted nuclear according to the descending order of the numbering of transmitting nuclear and form a ring.All forwarding nuclears with in the route system are core-1, core-2 ... core-N, what this each forwarding was examined is numbered 1,2 ... N, based on this, clockwise can be as shown in Figure 3 according to the order that numbering is descending with ring of all forwarding nuclear compositions.
Step 102, each transmits nuclear after the resource of new resources pointed more, and the resource that this resource pointer was pointed to before upgrading is as the resource that needs discharge, and deposits to transmit the resource that nuclear is assigned with to the next one and discharge in the formation.
Based on above-described all forwarding nuclears in the route system are organized according to the rule of setting; Be all to be transmitted nuclear form a ring successively according to the order of setting; Can obtain, the next one in this step 102 is transmitted nuclear and is current forwarding nuclear perhaps anticlockwise along clockwise direction adjacent forwarding nuclear in ring.
In addition, in this step 102, transmitting resource that nuclear is assigned with, to discharge formation be pre-assigned, and resource discharges formation and is used to deposit the resource that needs discharge, and according to the resource of its needs of depositing release of first in first out (FIFO:First In First Out) tissue.Wherein, it is separate that the resource release formation that is assigned with is examined in each forwarding.
With Fig. 2 is example; If in this step 102; Core-1 is the resource of new resources pointed more, and then this core-1 deposits the resource that this resource pointer pointed to the resource that core-2 was assigned with release formation shown in Figure 2 as the resource of needs release before upgrading.
Step 103, the resource that each forwarding nuclear inspection self is assigned with discharges the resource whether formation exists needs to discharge, if; Then take out the resource that each need discharge successively; And judge that whether this resource is because self more resource and resource that definite needs discharge of new resources pointed, if then discharge this resource; Otherwise, this resource is continued to deposit the resource that is assigned with to next one forwarding nuclear as the resource that needs discharge discharges in the formation.
In this step 103, the resource that each forwarding nuclear inspection self is assigned with discharges the operation whether formation exists the resource of needs release, is after the processing message is perhaps handled message before, to carry out, and the present invention is specifically qualification.
So far, accomplish flow process shown in Figure 1.
Can find out from flow process shown in Figure 1; Among the present invention; Each transmit nuclear at it because the resource of new resources pointed and resource that definite needs discharge just discharges this resource after transmitting nuclear through all more; Promptly when all forwarding nuclears are not visited this resource, just in time do not discharge this resource, this can not influence resource access on the one hand, can in time discharge resource on the other hand yet; Can not cause the waste of resource, poor efficiency, the even not reliable defective of avoiding time-based delay memory method for releasing to be brought.
So far, accomplish method provided by the invention and describe, describe in the face of route system provided by the invention down:
Referring to Fig. 4, the route system structure chart that Fig. 4 provides for the embodiment of the invention.As shown in Figure 4, this route system comprises: OU, dispensing unit and a plurality of forwarding nuclear, wherein,
Said OU is used for all forwarding nuclears of route system are organized according to the rule of setting;
Said dispensing unit is used to each and transmits nuclear distributing independent resource release formation; Particularly, to discharge formation be the resource that the needs according to the mode organize of FIFO discharge for each resource.
Each is transmitted nuclear and comprises: first processing unit and second processing unit, wherein,
Said first processing unit; Be used for after the resource of new resources pointed is more examined in its residing forwarding; The resource that this resource pointer was pointed to before upgrading is as the resource that needs discharge, and deposits to the next one of this forwardings nuclear and transmits in the resource release formation that nuclear is assigned with;
Said second processing unit; Be used to check that the resource that its residing forwarding nuclear is assigned with discharges the resource whether formation exists needs to discharge; If then take out the resource that each need discharge successively, and judge that whether this resource is the resource that definite needs discharge because the resource of new resources pointed is more examined in its residing forwarding; If; Then discharge this resource, otherwise, with this resource continue as the resource that needs discharge deposit to this forwardings nuclear the next one transmit in the resource release formation that nuclear is assigned with.Wherein, said second processing unit is to check before handling message or after handling message that the resource that its residing forwarding nuclear is assigned with discharges the resource whether formation exists needs to discharge.
Particularly, among the present invention, said OU is organized according to the rule of setting all the forwarding nuclears in the route system, is all to be transmitted nuclear form a ring successively according to the order of setting; Correspondingly, the said next nuclear of transmitting is current forwarding nuclear perhaps anticlockwise along clockwise direction adjacent forwarding nuclear in ring.
Preferably, among the present invention, said OU is organized according to the rule of setting all the forwarding nuclears in the route system, is meant:
Clockwise all are transmitted nuclear according to the ascending order of the numbering of transmitting nuclear and form a ring; Perhaps,
Clockwise all are transmitted nuclear according to the descending order of the numbering of transmitting nuclear and form a ring.
So far, accomplish route system structrual description provided by the invention.
Can find out by above technical scheme; Among the present invention; In the ring each transmit nuclear at it because more the resource of new resources pointed and resource that definite needs discharge just discharge this resource after transmitting nuclear through all of whole ring; Promptly when all forwarding nuclears are not visited this resource, just in time do not discharge this resource, this can not influence resource access on the one hand, can in time discharge resource on the other hand yet; Can not cause the waste of resource, poor efficiency, the even not reliable defective of avoiding time-based delay memory method for releasing to be brought.
The above is merely preferred embodiment of the present invention, and is in order to restriction the present invention, not all within spirit of the present invention and principle, any modification of being made, is equal to replacement, improvement etc., all should be included within the scope that the present invention protects.

Claims (10)

1. an internal memory method for releasing is characterized in that, this method comprises:
All forwarding nuclears in the route system are organized according to the rule of setting successively;
Each transmits nuclear after the resource of new resources pointed more, and the resource that this resource pointer was pointed to before upgrading is as the resource that needs discharge, and deposits to transmit the resource that nuclear is assigned with to the next one and discharge in the formation;
The resource that each forwarding nuclear inspection self is assigned with discharges the resource whether formation exists needs to discharge; If then take out the resource that each need discharge successively, and judge that whether this resource is because self more resource and resource that definite needs discharge of new resources pointed; If; Then discharge this resource, otherwise, this resource is continued to deposit the resource that is assigned with to next one forwarding nuclear as the resource that needs discharge discharge in the formation.
2. method according to claim 1 is characterized in that, said all forwardings in the route system are examined according to the rule of setting organized, and is all to be transmitted nuclear form a ring successively according to the order of setting; The said next nuclear of transmitting is current forwarding nuclear perhaps anticlockwise along clockwise direction adjacent forwarding nuclear in ring.
3. method according to claim 1 and 2 is characterized in that, all the forwarding nuclears in the route system are organized according to the rule of setting, and is meant:
Clockwise all are transmitted nuclear according to the ascending order of the numbering of transmitting nuclear and form a ring; Perhaps,
Clockwise all are transmitted nuclear according to the descending order of the numbering of transmitting nuclear and form a ring.
4. method according to claim 1 is characterized in that, resource discharges the resource of formation according to the needs release of the mode organize of fifo fifo.
5. method according to claim 1 is characterized in that, the resource that said each forwarding nuclear inspection self is assigned with discharges the operation whether formation exists the resource of needs release, is after the processing message is perhaps handled message before, to carry out.
6. a route system is characterized in that, this route system comprises: OU, dispensing unit and a plurality of forwarding nuclear, wherein,
Said OU is used for all forwarding nuclears of route system are organized according to the rule of setting;
Said dispensing unit is used to each and transmits nuclear distributing independent resource release formation;
Each is transmitted nuclear and comprises: first processing unit and second processing unit, wherein,
Said first processing unit; Be used for after the resource of new resources pointed is more examined in its residing forwarding; The resource that this resource pointer was pointed to before upgrading is as the resource that needs discharge, and deposits to the next one of this forwardings nuclear and transmits in the resource release formation that nuclear is assigned with;
Said second processing unit; Be used to check that the resource that its residing forwarding nuclear is assigned with discharges the resource whether formation exists needs to discharge; If then take out the resource that each need discharge successively, and judge that whether this resource is the resource that definite needs discharge because the resource of new resources pointed is more examined in its residing forwarding; If; Then discharge this resource, otherwise, this resource is continued to deposit the resource that is assigned with to the next one forwarding nuclear of this forwarding nuclear as the resource that needs discharge discharge in the formation.
7. route system according to claim 6 is characterized in that, said OU is organized according to the rule of setting all the forwarding nuclears in the route system, is all to be transmitted nuclear form a ring successively according to the order of setting; The said next nuclear of transmitting is current forwarding nuclear perhaps anticlockwise along clockwise direction adjacent forwarding nuclear in ring.
8. route system according to claim 6 is characterized in that, said dispensing unit discharges the resource of formation according to the needs release of the mode organize of fifo fifo for each resource of transmitting the nuclear distribution.
9. route system according to claim 6 is characterized in that, said second processing unit is to check before handling message or after handling message that the resource that its residing forwarding nuclear is assigned with discharges the resource whether formation exists needs to discharge.
10. according to claim 6 or 7 described route systems, it is characterized in that said OU is organized according to the rule of setting all the forwarding nuclears in the route system, is meant:
Clockwise all are transmitted nuclear according to the ascending order of the numbering of transmitting nuclear and form a ring; Perhaps,
Clockwise all are transmitted nuclear according to the descending order of the numbering of transmitting nuclear and form a ring.
CN201110314529.7A 2011-10-17 2011-10-17 Memory release method and routing system Active CN102325091B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110314529.7A CN102325091B (en) 2011-10-17 2011-10-17 Memory release method and routing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110314529.7A CN102325091B (en) 2011-10-17 2011-10-17 Memory release method and routing system

Publications (2)

Publication Number Publication Date
CN102325091A true CN102325091A (en) 2012-01-18
CN102325091B CN102325091B (en) 2014-09-17

Family

ID=45452763

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110314529.7A Active CN102325091B (en) 2011-10-17 2011-10-17 Memory release method and routing system

Country Status (1)

Country Link
CN (1) CN102325091B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108259369A (en) * 2018-01-26 2018-07-06 迈普通信技术股份有限公司 The retransmission method and device of a kind of data message

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006077260A1 (en) * 2005-01-24 2006-07-27 International Business Machines Corporation Method for optimising the logging and replay of multi-task applications in a mono-processor or multi-processor computer system
CN101093450A (en) * 2006-06-19 2007-12-26 迈普(四川)通信技术有限公司 Mutual exclusion method for multiple CPUs
CN101350010A (en) * 2007-07-20 2009-01-21 迈普(四川)通信技术有限公司 Operation method of hash table
CN101789959A (en) * 2009-12-30 2010-07-28 北京天融信科技有限公司 SKB reusing method and device in multinuclear system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006077260A1 (en) * 2005-01-24 2006-07-27 International Business Machines Corporation Method for optimising the logging and replay of multi-task applications in a mono-processor or multi-processor computer system
CN101093450A (en) * 2006-06-19 2007-12-26 迈普(四川)通信技术有限公司 Mutual exclusion method for multiple CPUs
CN101350010A (en) * 2007-07-20 2009-01-21 迈普(四川)通信技术有限公司 Operation method of hash table
CN101789959A (en) * 2009-12-30 2010-07-28 北京天融信科技有限公司 SKB reusing method and device in multinuclear system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108259369A (en) * 2018-01-26 2018-07-06 迈普通信技术股份有限公司 The retransmission method and device of a kind of data message
CN108259369B (en) * 2018-01-26 2022-04-05 迈普通信技术股份有限公司 Method and device for forwarding data message

Also Published As

Publication number Publication date
CN102325091B (en) 2014-09-17

Similar Documents

Publication Publication Date Title
CN100458757C (en) Inter core communication method and apparatus for multi-core processor in embedded real-time operating system
CN103348640B (en) Relay
CN102255794B (en) Remote message transmit-receive handling capacity and waiting time shortening system and method
US7738443B2 (en) Asynchronous broadcast for ordered delivery between compute nodes in a parallel computing system where packet header space is limited
US9569291B1 (en) Systems and methods for inter-process messaging
CN109408257B (en) Data transmission method and device for Network On Chip (NOC) and electronic equipment
CN105511954A (en) Method and device for message processing
CN102195874A (en) Pre-fetching of data packets
CN102549552A (en) Method for processing data packets in flow-aware network nodes
TWI706314B (en) Memory system for a network device, the network device, and method for operating the network device
CN109710414B (en) Job scheduling method, device, equipment and storage medium
US11172016B2 (en) Device, method and system to enforce concurrency limits of a target node within a network fabric
CN103678199A (en) Data transmission method and data transmission equipment
CN105573711B (en) A kind of data cache method and device
CN105740178B (en) Chip network system with and forming method thereof
CN103455371A (en) Mechanism for optimized intra-die inter-nodelet messaging communication
CN103986585A (en) Message preprocessing method and device
CN103166845A (en) Data processing method and device
CN102325091A (en) Memory release method and routing system
US20120265883A1 (en) Multiple overlapping block transfers
US9170979B2 (en) Converging interconnect node controlling operation related to associated future item in dependence upon data predicted based on current transaction data item passing through
CN104769553A (en) System and method for supporting work sharing muxing in a cluster
CN104125169B (en) Chained list processing unit, chained list processing method and related network switch
US9338219B2 (en) Direct push operations and gather operations
CN105637475B (en) Concurrent access method and system

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
CP02 Change in the address of a patent holder

Address after: 610041 15-24 floor, 1 1 Tianfu street, Chengdu high tech Zone, Sichuan

Patentee after: MAIPU COMMUNICATION TECHNOLOGY Co.,Ltd.

Address before: 610041 Sichuan city of Chengdu province high tech Zone nine Hing Road No. 16 building, Maipu

Patentee before: MAIPU COMMUNICATION TECHNOLOGY Co.,Ltd.

CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 610041 nine Xing Xing Road 16, hi tech Zone, Sichuan, Chengdu

Patentee after: MAIPU COMMUNICATION TECHNOLOGY Co.,Ltd.

Address before: 610041 15-24 floor, 1 1 Tianfu street, Chengdu high tech Zone, Sichuan

Patentee before: MAIPU COMMUNICATION TECHNOLOGY Co.,Ltd.

CP02 Change in the address of a patent holder