CN105378652B - Thread shared resource distribution method and device - Google Patents

Thread shared resource distribution method and device Download PDF

Info

Publication number
CN105378652B
CN105378652B CN201380077895.2A CN201380077895A CN105378652B CN 105378652 B CN105378652 B CN 105378652B CN 201380077895 A CN201380077895 A CN 201380077895A CN 105378652 B CN105378652 B CN 105378652B
Authority
CN
China
Prior art keywords
long delay
delay operation
subject thread
thread
replaced
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201380077895.2A
Other languages
Chinese (zh)
Other versions
CN105378652A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN105378652A publication Critical patent/CN105378652A/en
Application granted granted Critical
Publication of CN105378652B publication Critical patent/CN105378652B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals

Abstract

The embodiment of the present invention, which provides a kind of thread shared resource distribution method and device, this method, to be included:Determine that the subject thread has carried out long delay operation according to the long delay operation judges signal that subject thread is sent;Count the number that the subject thread in preset time carries out long delay operation;Weighted value is replaced according to what the subject thread carried out that accessed frequency of target resource etc. in the number of long delay operation, predetermined system weight coefficient, default weight adjustable strategies value and the subject thread determines the target resource;The target resource is redistributed according to the weighted value that is replaced.In the embodiment of the present invention, the distribution realized to multithreading shared resource is more reasonable, avoid the waste of resource, and the probability that the valuable source for reducing some critical threads is replaced, after avoiding subject thread from discharging some valuable sources, reacquired again when reusing and cause subject thread hydraulic performance decline, so as to ensure that the performance of subject thread.

Description

Thread shared resource distribution method and device
Technical field
The present invention relates to the communication technology, more particularly to a kind of thread shared resource distribution method and device.
Background technology
Synchronizing multiple threads (Simultaneous Multi Threading, abbreviation SMT) technology is a kind of processor technology, SMT structures by the configuration state on copying processor, enable a processor to perform simultaneously a plurality of instruction from different threads, The Thread-Level Parallelism for excavating the instruction level parallelism inside single thread and cross-thread is unrestrained to reduce the level of processor internal pipeline Take and vertical waste, wide transmitting, the processing of out of order superscale can be realized to greatest extent, to improve the profit of processor arithmetic unit With rate.Above-mentioned SMT structures combine the ability of superscalar architecture multi-emitting and traditional multithreaded architecture hides the ability of delay, The difference is that the execution resource that is switched fast come shared processor of traditional multithreaded architecture by context, and above-mentioned SMT Structure keeps multiple contexts while actively competes execution resource.This SMT structures by thread to resource it is shared come Improve resource utilization.
In the prior art, the long delay operation to each thread judges, long delay operation finger processor needs tens It is individual in addition hundreds of processor clock could returning result operation, if it is determined that certain thread has long delay operation, then discharge Thread resource shared in shared resource.
But using prior art, in the case where shared resource competition is not fierce, above-mentioned thread can be caused on the contrary Hydraulic performance decline;And cannot be guaranteed that critical thread is to the priority of shared resource in system, so as to influence the key performance of system Index.
The content of the invention
The embodiment of the present invention provides a kind of thread shared resource distribution method and device, for solving existing shared resource point Method of completing the square can influence the problem of thread performance.
First aspect of the embodiment of the present invention provides a kind of thread shared resource distribution method, including:
Determine that the subject thread has carried out long delay operation according to the long delay operation judges signal that subject thread is sent;
Count the number that the subject thread in preset time carries out long delay operation;
The number, predetermined system weight coefficient, default weight adjustment plan of long delay operation are carried out according to the subject thread What accessed frequency of target resource etc. determined the target resource slightly in value and the subject thread is replaced weighted value, its In, multithreading shared resource that the target resource is occupied by the subject thread;
The target resource is redistributed according to the weighted value that is replaced.
With reference to the length in a first aspect, in the first possible embodiment of first aspect, sent according to subject thread Delay operation judges that signal determines that the subject thread has carried out long delay operation, including:
Receive the long delay operation judges signal that the subject thread is sent;
Determine that the subject thread has carried out long delay operation according to the long delay operation judges signal.
With reference to the first possible embodiment of first aspect, in second of possible embodiment of first aspect In, the long delay operation judges signal includes:Long delay operation signal, and corresponding with the long delay operation signal visit Ask information;The long delay operation includes:The operation of main memory is accessed due to cache miss, or, the visit of distal end shared drive Ask operation.
It is any in second of possible embodiment with reference to first aspect to first aspect, the 3rd of first aspect the In the possible embodiment of kind, the long delay operation judges signal sent according to subject thread determines that the subject thread is entered Before long delay of having gone operation, in addition to:
Obtain the predetermined system weight coefficient and the default weight adjustable strategies value.
With reference in a first aspect, in the 4th kind of possible embodiment of first aspect, power is replaced described in the basis The target resource is redistributed again, including:
Be replaced weight according to described, allow the target resource preferentially to be replaced, or reduce the target resource by for The probability changed.
Second aspect of the embodiment of the present invention provides a kind of thread shared resource distributor, including:
First determining module, the long delay operation judges signal for being sent according to subject thread determine the subject thread Long delay operation is carried out;
Counting module, the number of long delay operation is carried out for counting the subject thread in preset time;
Second determining module, for carrying out number, the predetermined system weight system of long delay operation according to the subject thread Accessed frequency of target resource etc. determines the target resource in number, default weight adjustable strategies value and the subject thread Be replaced weighted value, wherein, the multithreading shared resource that the target resource is occupied by the subject thread;
Distribute module, the target resource is redistributed for being replaced weighted value according to.
With reference to second aspect, in the first possible embodiment of second aspect, first determining module, specifically The long delay operation judges signal sent for receiving the subject thread;Institute is determined according to the long delay operation judges signal State subject thread and carry out long delay operation.
With reference to the first possible embodiment of second aspect, in second of possible embodiment of second aspect In, the long delay operation judges signal includes:Long delay operation signal, and corresponding with the long delay operation signal visit Ask information;The long delay operation includes:The operation of main memory is accessed due to cache miss, or, the visit of distal end shared drive Ask operation.
It is any in second of possible embodiment with reference to second aspect to second aspect, the 3rd of second aspect the In the possible embodiment of kind, described device also includes:
Acquisition module, for determining that the subject thread is entered in the long delay operation judges signal sent according to subject thread Before long delay of having gone operation, the predetermined system weight coefficient and the default weight adjustable strategies value are obtained.
With reference to second aspect, in the first possible embodiment of second aspect, the distribute module, it is specifically used for Weight is replaced according to described, allows the target resource preferentially to be replaced, or reduces the probability that the target resource is replaced.
The third aspect of the embodiment of the present invention provides a kind of thread shared resource distributor, including:
Memory, for store instruction;
Processor, coupled with the memory, be configured as performing the instruction being stored in the memory, for basis The long delay operation judges signal that subject thread is sent determines that the subject thread has carried out long delay operation;Count preset time The interior subject thread carries out the number of long delay operation;The number of long delay operation is carried out according to the subject thread, preset Accessed frequency of target resource etc. determines institute in system weight coefficient, default weight adjustable strategies value and the subject thread That states target resource is replaced weighted value, wherein, the shared money of multithreading that the target resource is occupied by the subject thread Source;The target resource is redistributed according to the weighted value that is replaced.
With reference to the third aspect, in the first possible embodiment of the third aspect, the processor, specifically for connecing Receive the long delay operation judges signal that the subject thread is sent;The target is determined according to the long delay operation judges signal Thread has carried out long delay operation.
With reference to the first possible embodiment of the third aspect, in second of possible embodiment of the third aspect In, the long delay operation judges signal includes:Long delay operation signal, and corresponding with the long delay operation signal visit Ask information;The long delay operation includes:The operation of main memory is accessed due to cache miss, or, the visit of distal end shared drive Ask operation.
It is any in second of possible embodiment with reference to the third aspect to the third aspect, the 3rd of the third aspect the In the possible embodiment of kind, the processor, it is additionally operable to true in the long delay operation judges signal sent according to subject thread Before the fixed subject thread has carried out long delay operation, the predetermined system weight coefficient and the default weight adjustment are obtained Strategy value.
With reference to the third aspect, in the 4th kind of possible embodiment of the third aspect, the processor is specifically used for root Weight is replaced according to described, allows the target resource preferentially to be replaced, or reduces the probability that the target resource is replaced.
In the present embodiment, determine that the subject thread is carried out according to the long delay operation judges signal that subject thread is sent Long delay operates, and counts the number of long delay operation, and then carries out the number of long delay operation, default system according to subject thread The accessed frequency of target resource determines target resource in system weight coefficient, default weight adjustable strategies value and subject thread Weighted value is replaced, be replaced weighted value according to this redistributes when needed to target resource.Realize to multithreading The distribution of shared resource is more reasonable, as the case may be, allows some target resources to be preferentially replaced so that other threads can be with Competition, avoids the waste of resource, and the probability that the valuable source for reducing some critical threads is replaced, and avoids subject thread will After the release of some valuable sources, reacquired again when reusing and cause subject thread hydraulic performance decline, so as to ensure that target The performance of thread.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are this hairs Some bright embodiments, for those of ordinary skill in the art, without having to pay creative labor, can be with Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of thread shared resource distribution method embodiment one provided by the invention;
Fig. 2 is the structural representation of thread shared resource distributor embodiment one provided by the invention;
Fig. 3 is the structural representation of thread shared resource distributor embodiment two provided by the invention;
Fig. 4 is the structural representation of thread shared resource distributor embodiment three provided by the invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is Part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Fig. 1 is the schematic flow sheet of thread shared resource distribution method embodiment one provided by the invention, and this method is more Performed in threaded systems, as shown in figure 1, this method includes:
S101, the long delay operation (Long Latency Event, abbreviation LLE) sent according to subject thread judge signal Determine that above-mentioned subject thread has carried out long delay operation.
Above-mentioned subject thread carries out the number of long delay operation in S102, statistics preset time.Specifically, often carry out once Long delay is operated, and 1 is just added on the number of statistics.Determining that subject thread is carried out according to long delay operation judges signal After long delay operation, just carry out plus 1 operates.
It is periodically to be counted during specific implementation, timing can be carried out with passage time window timer, it is above-mentioned Preset time can refer to the time of a cycle, and time window timer resets counting before when reaching threshold value, i.e., under A cycle starts to re-start statistics.
S103, the number of long delay operation, predetermined system weight coefficient, default weight are carried out according to above-mentioned subject thread adjusted What the accessed frequency of target resource determined the target resource in whole strategy value and subject thread is replaced weighted value.Wherein, The multithreading shared resource that above-mentioned target resource is occupied by subject thread.
S104, according to the above-mentioned weighted value that is replaced above-mentioned target resource is redistributed.Specifically, can need When wanting, above-mentioned target resource is redistributed.Might not just it be provided when time window timer reaches threshold value Source is redistributed, but is carried out resource again when other threads or subject thread need to apply new shared resource and redistributed.
It is above-mentioned that above-mentioned target resource is redistributed according to the above-mentioned weighted value that is replaced during specific implementation, can To be according to being replaced weighted value, target resource is allowed preferentially to be replaced, or, reduce the probability that target resource is replaced.Will The shared resource that subject thread is occupied preferentially is replaced, or reduce the shared resource occupied of subject thread be replaced it is general Rate.Specifically can be by setting default weight adjustable strategies value to realize:Such as the default weight adjustable strategies value can be set to be 1, to represent that long delay operation is more, weighted value is replaced with regard to smaller, long delay operation is fewer, and it is bigger to be replaced weighted value; It is 0 to set default weight adjustable strategies value, and to represent that long delay operation is more, it is bigger to be replaced weighted value, long delay operation It is fewer, weighted value is replaced with regard to smaller.Then set and be total to when replacing weight coefficient in a range by what subject thread was occupied Resource priority replacement is enjoyed, illustrates that contribution of these resources to subject thread be smaller in this case or after the subject thread belongs to Platform applies (work that i.e. its operation timeliness does not influence machine system), and these resources are discharged, and needs these to allow The thread of resource goes to compete, and then the subject thread is gone to compete the subject thread resource more needed and is replaced;Another In the range of when, reduce the probability that the shared resource occupied of subject thread is replaced, illustrate these resources to mesh in this case Graticule journey is more important, does not allow these resources to be replaced as far as possible.
In the present embodiment, determine that the subject thread is carried out according to the long delay operation judges signal that subject thread is sent Long delay operates, and counts the number of long delay operation, and then carries out the number of long delay operation, default system according to subject thread The accessed frequency of target resource determines target resource in system weight coefficient, default weight adjustable strategies value and subject thread Weighted value is replaced, be replaced weighted value according to this redistributes when needed to target resource.Realize to multithreading The distribution of shared resource is more reasonable, as the case may be, allows some target resources to be preferentially replaced so that other threads can be with Competition, avoids the waste of resource, and the probability that the valuable source for reducing some critical threads is replaced, and avoids subject thread will After the release of some valuable sources, reacquired again when reusing and cause subject thread hydraulic performance decline, so as to ensure that target The performance of thread.
Further, the above-mentioned LLE sent according to subject thread judges that signal determines that above-mentioned subject thread has carried out length and prolonged When operate, be specially:Receive the LLE that above-mentioned subject thread is sent and judge signal;Judge that signal determines above-mentioned target according to the LLE Thread has carried out long delay operation.
Specifically, in the embodiment of the present invention, long delay operation refers specifically to need tens even hundreds of processor clocks The operation of ability returning result, can include:The operation of main memory is accessed due to cache miss, or, distal end shared drive Operation is accessed, but is not limited thereto.When longer operation occurs to be delayed for subject thread, such as:Last level cache is lost, is remote End data access etc., subject thread can send long delay operation judges signal, the LLE can be judged into signal is sent to the present invention The thread shared resource distributor that embodiment provides, is judged by the long delay judge module in device, and long delay judges Whether it is long delay operation, if long delay operates, then carry out subject thread that module can be judged according to signal is judged The number of long delay operation adds 1.It should be noted that above-mentioned long delay operation judges signal can include:Above-mentioned long delay behaviour Make signal (LLE-like), and the corresponding access information of long delay operation signal.Wherein corresponding access information can be: Access request, the target address information of the access, reading writing information, the subject thread information etc. of the access.During specific implementation, Which signal can be used for judging LLE, can be configured by machine system according to being actually needed.
Further, the above-mentioned LLE sent according to subject thread judges that signal determines that above-mentioned subject thread is grown Before delay operation, in addition to obtain above-mentioned predetermined system weight coefficient and default weight adjustable strategies value.Specific implementation process In, predetermined system weight coefficient and default weight adjustable strategies are all that system manager is carried out according to the application demand of machine system Configuration, such as:According to application scenarios, it is 1 to set default weight adjustable strategies value, to represent that long delay operation is more, is replaced For weighted value with regard to smaller, long delay operation is fewer, and it is bigger to replace weighted value;It is 0 to set default weight adjustable strategies value, to represent Long delay operation is more, and replacement weighted value is bigger, and long delay operation is fewer, replaces weighted value with regard to smaller.But not as Limit, moreover, said system keeper can also adjust above-mentioned setting in system operation according to actual conditions dynamic.
During specific implementation, number, the predetermined system that long delay operation is carried out according to above-mentioned subject thread are illustrated The accessed frequency of target resource determines the quilt of the target resource in weight coefficient, default weight adjustable strategies and subject thread Weighted value is replaced, weight adjustable strategies value is 1 in the example, and to represent that long delay operation is more, replacement weighted value is just smaller, and length is prolonged When operation it is fewer, replace weighted value it is bigger.The default weight adjustable strategies value of note is W_str (i), remembers predetermined system weight coefficient For W (i), the accessed frequency for remembering target resource in subject thread is Re cenly (i), and note subject thread carries out long delay operation Number be LLe_cnt (i), target resource can be calculated according to following formula and be replaced weighted value Cost (i):(1) if W_str (i)=1, Cost (i)=W (i)/LLe_cnt (i) * Re cenly (i);(2) if W_str (i)=0, Cost (i)= W(i)*Recenly(i)*LLe_cnt(i).Wherein " * " represents multiplication sign, and "/" represents the division sign.
To above-described embodiment for example, in application process:(1) under normal circumstances, rational predetermined system weight is set Coefficient and default weight adjustable strategies value so that long delay operating frequency is higher, and the probability that target resource is preferentially replaced is bigger, To reduce interference of the subject thread to other threads in multi-threaded system.(2) illustrated with the cache resources in smt processor It is bright, in some applications, the situation of the either caching (cache) without the second level or the third level (L2/L3) etc. can closed Under, predetermined system weight coefficient should be adjusted, the cache lines (Cache Line) in first order caching is reduced as far as possible because of it The probability that the long delay of his thread is operated and is replaced away repeatedly, in case the cost (penalty) brought is too big.Need to illustrate , the competition of the resource during each thread caches to the first order here is in units of Cache Line.(3) some moment, The Thread Count of operation is fewer simultaneously in system, and now the competition of shared resource is smaller between multithreading, can adjust default system System weighted value, reduces the probability that target resource is replaced as far as possible, reduces the swapping in and out of resource in subject thread.(4) it is above-mentioned pre- If the length of time can also influence to replace the adjustment frequency of weighted value, under some application scenarios, less preset time is set, i.e., The cycle of statistics is smaller, can so adjust replacement weighted value in the short period of time.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass through Programmed instruction related hardware is completed, and foregoing program can be stored in a computer read/write memory medium, the program Upon execution, the step of execution includes above method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or light Disk etc. is various can be with the medium of store program codes.
Fig. 2 is the structural representation of thread shared resource distributor embodiment one provided by the invention, as shown in Fig. 2 The device includes:First determining module 201, counting module 202, the second determining module 203 and distribute module 204.Wherein:
First determining module 201, the long delay operation judges signal for being sent according to subject thread determine the target Thread has carried out long delay operation.
Counting module 202, the number of long delay operation is carried out for counting the subject thread in preset time.
Second determining module 203, for carrying out number, the predetermined system weight of long delay operation according to the subject thread Accessed frequency of target resource etc. determines the target money in coefficient, default weight adjustable strategies value and the subject thread Source is replaced weighted value, wherein, the multithreading shared resource that the target resource is occupied by the subject thread.
Distribute module 204, the target resource is redistributed for being replaced weighted value according to.
Further, the first determining module 201, the long delay operation judges sent specifically for receiving the subject thread Signal;Determine that the subject thread has carried out long delay operation according to the long delay operation judges signal.
It should be noted that the long delay operation judges signal includes:Long delay operation signal, and prolong with the length When the corresponding access information of operation signal;The long delay operation includes:The operation of main memory is accessed due to cache miss, or Person, the access operation of distal end shared drive.
Fig. 3 is the structural representation of thread shared resource distributor embodiment two provided by the invention, on Fig. 2 basis On, the device includes:
Acquisition module 205, for determining the score in the long delay operation judges signal sent according to subject thread Before the operation of Cheng Jinhang long delays, the predetermined system weight coefficient and the default weight adjustable strategies value are obtained.
In addition, above-mentioned distribute module 204, specifically for being replaced weight according to, makes the target resource preferential Replace, or reduce the probability that the target resource is replaced.
Above-mentioned each module is used to perform preceding method embodiment, and its implementing principle and technical effect is similar, no longer superfluous herein State.
Fig. 4 is the structural representation of thread shared resource distributor embodiment three provided by the invention, as shown in figure 4, The device includes:Memory 401 and processor 402, wherein,
Memory 401, for store instruction.
Processor 402, coupled with memory 401, be configured as performing the instruction being stored in memory 401, specifically, Long delay operation judges signal for being sent according to subject thread determines that the subject thread has carried out long delay operation;Statistics The subject thread carries out the number of long delay operation in preset time;Time of long delay operation is carried out according to the subject thread The accessed frequency of target resource in number, predetermined system weight coefficient, default weight adjustable strategies value and the subject thread Weighted value is replaced Deng the determination target resource, wherein, the target resource is occupied multi-thread by the subject thread Journey shared resource;The target resource is redistributed according to the weighted value that is replaced.
Further, above-mentioned processor 402, the long delay operation judges sent specifically for receiving the subject thread are believed Number;Determine that the subject thread has carried out long delay operation according to the long delay operation judges signal.
Processor 402, specifically for being replaced weight according to, the target resource is allowed preferentially to be replaced, or drop The probability that the low target resource is replaced.
It should be noted that the long delay operation judges signal includes:Long delay operation signal, and prolong with the length When the corresponding access information of operation signal;The long delay operation includes:The operation of main memory is accessed due to cache miss, or Person, the access operation of distal end shared drive.
In addition, above-mentioned processor 402, is additionally operable to determine institute in the long delay operation judges signal sent according to subject thread State subject thread carried out long delay operation before, obtain the predetermined system weight coefficient and the default weight adjustable strategies Value.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent The present invention is described in detail with reference to foregoing embodiments for pipe, it will be understood by those within the art that:Its according to The technical scheme described in foregoing embodiments can so be modified, either which part or all technical characteristic are entered Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology The scope of scheme.

Claims (15)

  1. A kind of 1. thread shared resource distribution method, it is characterised in that including:
    Determine that the subject thread has carried out long delay operation according to the long delay operation judges signal that subject thread is sent;It is described Long delay operation is to need multiple processor clocks to obtain the operation of returning result;The multiple processor clock to be more than or Person is equal to the processor clock of 10;
    Count the number that the subject thread in preset time carries out long delay operation;
    The number, predetermined system weight coefficient, default weight adjustable strategies value of long delay operation are carried out according to the subject thread And in the subject thread the accessed frequency of target resource determine the target resource be replaced weighted value, wherein, institute State the multithreading shared resource that target resource is occupied by the subject thread;
    The target resource is redistributed according to the weighted value that is replaced.
  2. 2. according to the method for claim 1, it is characterised in that the long delay operation judges signal sent according to subject thread Determine that the subject thread has carried out long delay operation, including:
    Receive the long delay operation judges signal that the subject thread is sent;
    Determine that the subject thread has carried out long delay operation according to the long delay operation judges signal.
  3. 3. according to the method for claim 2, it is characterised in that the long delay operation judges signal includes:Long delay is grasped Make signal, and access information corresponding with the long delay operation signal;The long delay operation includes:Due to cache miss And the operation hosted is accessed, or, the access operation of distal end shared drive.
  4. 4. according to the method described in claim any one of 1-3, it is characterised in that the long delay sent according to subject thread Before operation judges signal determines that the subject thread has carried out long delay operation, in addition to:
    Obtain the predetermined system weight coefficient and the default weight adjustable strategies value.
  5. 5. according to the method for claim 1, it is characterised in that weight is replaced described in the basis to the target resource Redistributed, including:
    Weight is replaced according to described, allows the target resource preferentially to be replaced, or reduces what the target resource was replaced Probability.
  6. A kind of 6. thread shared resource distributor, it is characterised in that including:
    First determining module, the long delay operation judges signal for being sent according to subject thread determine that the subject thread is carried out Long delay operation;The long delay operation is to need multiple processor clocks to obtain the operation of returning result;It is the multiple Processor clock is the processor clock more than or equal to 10;
    Counting module, the number of long delay operation is carried out for counting the subject thread in preset time;
    Second determining module, for carrying out the number of long delay operation, predetermined system weight coefficient, pre- according to the subject thread If in weight adjustable strategies value and the subject thread the accessed frequency of target resource determine the target resource by for Weighted value is changed, wherein, the multithreading shared resource that the target resource is occupied by the subject thread;
    Distribute module, the target resource is redistributed for being replaced weighted value according to.
  7. 7. device according to claim 6, it is characterised in that first determining module, specifically for receiving the mesh The long delay operation judges signal that graticule journey is sent;Determine that the subject thread is carried out according to the long delay operation judges signal Long delay operation.
  8. 8. device according to claim 7, it is characterised in that the long delay operation judges signal includes:Long delay is grasped Make signal, and access information corresponding with the long delay operation signal;The long delay operation includes:Due to cache miss And the operation hosted is accessed, or, the access operation of distal end shared drive.
  9. 9. according to the device described in claim any one of 6-8, it is characterised in that also include:
    Acquisition module, for determining that the subject thread is carried out in the long delay operation judges signal sent according to subject thread Before long delay operation, the predetermined system weight coefficient and the default weight adjustable strategies value are obtained.
  10. 10. device according to claim 6, it is characterised in that the distribute module, specifically for being replaced according to Weight, allow the target resource preferentially to be replaced, or reduce the probability that the target resource is replaced.
  11. A kind of 11. thread shared resource distributor, it is characterised in that including:
    Memory, for store instruction;
    Processor, coupled with the memory, be configured as performing the instruction being stored in the memory, for according to target The long delay operation judges signal that thread is sent determines that the subject thread has carried out long delay operation;The long delay operates Multiple processor clocks are needed to obtain the operation of returning result;The multiple processor clock is more than or equal to 10 Processor clock;Count the number that the subject thread in preset time carries out long delay operation;Entered according to the subject thread Target in number, predetermined system weight coefficient, default weight adjustable strategies value and the subject thread that row long delay operates What the accessed frequency of resource determined the target resource is replaced weighted value, wherein, the target resource is the score The multithreading shared resource that journey is occupied;The target resource is redistributed according to the weighted value that is replaced.
  12. 12. device according to claim 11, it is characterised in that the processor, specifically for receiving the score The long delay operation judges signal that journey is sent;Determine that the subject thread is grown according to the long delay operation judges signal Delay operation.
  13. 13. device according to claim 12, it is characterised in that the long delay operation judges signal includes:Long delay Operation signal, and access information corresponding with the long delay operation signal;The long delay operation includes:Lacked due to caching The operation hosted is lost and accesses, or, the access operation of distal end shared drive.
  14. 14. according to the device described in claim any one of 11-13, it is characterised in that the processor, be additionally operable to according to mesh Before the long delay operation judges signal that graticule journey is sent determines that the subject thread has carried out long delay operation, obtain described pre- If system weight coefficient and the default weight adjustable strategies value.
  15. 15. device according to claim 11, it is characterised in that the processor is specifically used for being replaced power according to Weight, allows the target resource preferentially to be replaced, or reduces the probability that the target resource is replaced.
CN201380077895.2A 2013-12-24 2013-12-24 Thread shared resource distribution method and device Active CN105378652B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/090326 WO2015096031A1 (en) 2013-12-24 2013-12-24 Method and apparatus for allocating thread shared resource

Publications (2)

Publication Number Publication Date
CN105378652A CN105378652A (en) 2016-03-02
CN105378652B true CN105378652B (en) 2018-02-06

Family

ID=53477311

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201380077895.2A Active CN105378652B (en) 2013-12-24 2013-12-24 Thread shared resource distribution method and device

Country Status (2)

Country Link
CN (1) CN105378652B (en)
WO (1) WO2015096031A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10176014B2 (en) 2015-07-27 2019-01-08 Futurewei Technologies, Inc. System and method for multithreaded processing
CN109308220B (en) * 2017-07-26 2021-12-14 华为技术有限公司 Shared resource allocation method and device
CN109874027A (en) * 2019-03-11 2019-06-11 宸瑞普惠(广州)科技有限公司 A kind of low delay educational surgery demonstration live broadcasting method and its system
CN114138685B (en) * 2021-12-06 2023-03-10 海光信息技术股份有限公司 Cache resource allocation method and device, electronic device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1955920A (en) * 2005-10-28 2007-05-02 国际商业机器公司 Method and apparatus for resource-based thread allocation in a multiprocessor computer system
CN101632236A (en) * 2007-03-21 2010-01-20 高通股份有限公司 Dynamic management of receiver resources
CN101826003A (en) * 2010-04-16 2010-09-08 中兴通讯股份有限公司 Multithread processing method and device
CN103440173A (en) * 2013-08-23 2013-12-11 华为技术有限公司 Scheduling method and related devices of multi-core processors

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040111594A1 (en) * 2002-12-05 2004-06-10 International Business Machines Corporation Multithreading recycle and dispatch mechanism
US7984248B2 (en) * 2004-12-29 2011-07-19 Intel Corporation Transaction based shared data operations in a multiprocessor environment
US9665375B2 (en) * 2012-04-26 2017-05-30 Oracle International Corporation Mitigation of thread hogs on a threaded processor and prevention of allocation of resources to one or more instructions following a load miss

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1955920A (en) * 2005-10-28 2007-05-02 国际商业机器公司 Method and apparatus for resource-based thread allocation in a multiprocessor computer system
CN101632236A (en) * 2007-03-21 2010-01-20 高通股份有限公司 Dynamic management of receiver resources
CN101826003A (en) * 2010-04-16 2010-09-08 中兴通讯股份有限公司 Multithread processing method and device
CN103440173A (en) * 2013-08-23 2013-12-11 华为技术有限公司 Scheduling method and related devices of multi-core processors

Also Published As

Publication number Publication date
CN105378652A (en) 2016-03-02
WO2015096031A1 (en) 2015-07-02

Similar Documents

Publication Publication Date Title
Usui et al. DASH: Deadline-aware high-performance memory scheduler for heterogeneous systems with hardware accelerators
Ebrahimi et al. Parallel application memory scheduling
US9898409B2 (en) Issue control for multithreaded processing
Alhammad et al. Time-predictable execution of multithreaded applications on multicore systems
US7366878B1 (en) Scheduling instructions from multi-thread instruction buffer based on phase boundary qualifying rule for phases of math and data access operations with better caching
US8898435B2 (en) Optimizing system throughput by automatically altering thread co-execution based on operating system directives
CN102473112B (en) The pre-filled method of cache, product and system about thread migration
US8195888B2 (en) Multiprocessor cache prefetch with off-chip bandwidth allocation
US9032156B2 (en) Memory access monitor
JP2017526996A5 (en)
CN105378652B (en) Thread shared resource distribution method and device
CN105786448B (en) A kind of instruction dispatching method and device
US9652243B2 (en) Predicting out-of-order instruction level parallelism of threads in a multi-threaded processor
CN105159654B (en) Integrity measurement hashing algorithm optimization method based on multi-threaded parallel
US20080098180A1 (en) Processor acquisition of ownership of access coordinator for shared resource
CN106462395A (en) Thread waiting in a multithreaded processor architecture
CN102473113A (en) Thread shift: allocating threads to cores
US8880809B2 (en) Memory controller with inter-core interference detection
US10019283B2 (en) Predicting a context portion to move between a context buffer and registers based on context portions previously used by at least one other thread
US20120079491A1 (en) Thread criticality predictor
Liu et al. SAWS: Synchronization aware GPGPU warp scheduling for multiple independent warp schedulers
CN106155794B (en) A kind of event dispatcher method and device applied in multi-threaded system
Mi et al. Software-hardware cooperative DRAM bank partitioning for chip multiprocessors
CN109101276A (en) The method executed instruction in CPU
CN101561766B (en) Low-expense block synchronous method supporting multi-core assisting thread

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