JP2012113487A - Multithread processor - Google Patents

Multithread processor Download PDF

Info

Publication number
JP2012113487A
JP2012113487A JP2010261361A JP2010261361A JP2012113487A JP 2012113487 A JP2012113487 A JP 2012113487A JP 2010261361 A JP2010261361 A JP 2010261361A JP 2010261361 A JP2010261361 A JP 2010261361A JP 2012113487 A JP2012113487 A JP 2012113487A
Authority
JP
Japan
Prior art keywords
access
thread
processing
task
instruction
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.)
Pending
Application number
JP2010261361A
Other languages
Japanese (ja)
Inventor
Hirohide Yamashiro
啓秀 山城
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.)
Toyota Motor Corp
Original Assignee
Toyota Motor 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 Toyota Motor Corp filed Critical Toyota Motor Corp
Priority to JP2010261361A priority Critical patent/JP2012113487A/en
Publication of JP2012113487A publication Critical patent/JP2012113487A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Multi Processors (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a multithread processor capable of improving processing efficiency.SOLUTION: A multithread processor is characterized by the presence of a plurality of threads for performing a hardware multi-threading processing. When the plurality of threads perform access processing to a specific shared access object, they request a dedicated thread, which performs access processing to the specific shared access object, to perform the access processing.

Description

本発明は、複数のスレッドが各自に処理を行うマルチスレッド処理装置に関し、特に、複数のスレッドによりハードウエア・マルチスレッディング処理を行うマルチスレッド処理装置に関する。   The present invention relates to a multi-thread processing apparatus in which a plurality of threads perform processing on each of them, and particularly to a multi-thread processing apparatus that performs hardware multi-threading processing by a plurality of threads.

近年、プロセッサの性能向上に伴い、複数の機能を一つのプロセッサにより実現させるための技術が研究・実用化されている。例えば、車両に搭載される車載制御装置の分野では、ある車載機器を制御する制御装置と他の車載機器を制御する制御装置(例えば変速機の制御装置とエンジンの制御装置等)を統合して、コンピュータ・ハードウエアを縮小し、コストや重量の低減を図る動きが見られる。   In recent years, techniques for realizing a plurality of functions by a single processor have been researched and put into practical use as the performance of the processor has been improved. For example, in the field of in-vehicle control devices mounted on vehicles, a control device that controls a certain in-vehicle device and a control device that controls other in-vehicle devices (for example, a transmission control device and an engine control device) are integrated. There is a trend to reduce computer hardware and reduce costs and weight.

こうしたハードウエア統合の一手法として、ハードウエア・マルチスレッディング処理と称されるものが知られている。ハードウエア・マルチスレッディング処理は、命令バッファや演算結果の格納場所(レジスタ)等を異にする複数のスレッドが、命令デコーダや演算回路等のハードウエアの一部を共有して処理を行なうものである。   One method of hardware integration is known as hardware multithreading processing. In hardware multithreading processing, multiple threads with different instruction buffers and operation result storage locations (registers) share part of the hardware such as instruction decoders and arithmetic circuits. .

ハードウエア・マルチスレッディング処理を行うマルチスレッド処理装置には、通常のコンピュータと同様、RAM等の記憶装置やI/O等のアクセス対象が存在する。こうしたアクセス対象には、一のスレッドのみがアクセス可能となるように制御される。このため、複数のスレッドが、時分割で並行処理している最中に同一のアクセス対象にアクセスしようとした場合、後にアクセス要求を出したスレッドが処理待ち状態となる。このため、処理待ち状態となったスレッドに対して供給されるクロックが無駄となる場合があった。   A multi-thread processing device that performs hardware multi-threading processing includes a storage device such as a RAM and an access target such as an I / O, as in a normal computer. Such an access target is controlled so that only one thread can access it. For this reason, when a plurality of threads try to access the same access target while performing parallel processing in a time-sharing manner, the thread that issued an access request later enters a processing wait state. For this reason, there is a case where the clock supplied to the thread waiting for processing is wasted.

一方、特許文献1には、上位装置からのライト命令に対応して下位装置であるディスクドライブ装置に対しライト命令のタスクを実行するディスクコントローラについて記載されている。このディスクコントローラでは、ライト命令の実行中のエラーを発見したときに、優先度の高い代替処理用タスクを発生させて、エラー処理を行わせるものとしている。   On the other hand, Patent Document 1 describes a disk controller that executes a write command task for a disk drive device, which is a lower-level device, in response to a write command from a higher-level device. In this disk controller, when an error is detected during execution of a write instruction, an alternative processing task having a high priority is generated and error processing is performed.

特開平2−173983号公報Japanese Patent Laid-Open No. 2-173983

しかしながら、上記特許文献1に記載のディスクコントローラは、エラーが発生した場合にのみ代替処理を発生させるため、エラーが発生しない通常処理状態において、処理効率を向上させることができない。   However, since the disk controller described in Patent Document 1 generates an alternative process only when an error occurs, the processing efficiency cannot be improved in a normal processing state where no error occurs.

また、上記特許文献1に記載のディスクコントローラにおける時分割マルチタスクシステムは、そもそもハードウエア・マルチスレッディングを前提としていない上、代替処理用タスクは、あくまでエラー処理を行うものであり、ハードウエア・マルチスレッディング処理を行うマルチスレッド処理装置において共有アクセス対象へのアクセスを代替処理するものではない。   In addition, the time division multitask system in the disk controller described in Patent Document 1 does not assume hardware multithreading in the first place, and the alternative processing task performs error processing to the last, and hardware multithreading processing. In the multi-thread processing apparatus that performs the above, access to the shared access target is not subjected to alternative processing.

本発明はこのような課題を解決するためのものであり、処理効率を向上させることが可能なマルチスレッド処理装置を提供することを、主たる目的とする。   The present invention is for solving such problems, and a main object of the present invention is to provide a multithread processing apparatus capable of improving the processing efficiency.

上記目的を達成するための本発明の一態様は、
複数のスレッドによりハードウエア・マルチスレッディング処理が行われるマルチスレッド処理装置であって、
前記複数のスレッドは、特定の共有アクセス対象へのアクセス処理を行う際には、該特定の共有アクセス対象へのアクセス処理を行う専用スレッドに、前記特定の共有アクセス対象へのアクセス処理の代行を依頼することを特徴とする、
マルチスレッド処理装置である。
In order to achieve the above object, one embodiment of the present invention provides:
A multi-thread processing device in which hardware multi-threading processing is performed by a plurality of threads,
When the plurality of threads perform an access process to a specific shared access target, a proxy thread that performs the access process to the specific shared access target is delegated to the specific shared access target. It is characterized by requesting,
A multi-thread processing device.

この本発明の一態様によれば、特定の共有アクセス対象へのアクセス処理を行う際には、該特定の共有アクセス対象へのアクセス処理を行う専用スレッドに、アクセス処理の代行を依頼するため、アクセス処理の代行を依頼したスレッドは、当該アクセス処理が終了するまでの間、他の一般処理を行うことができる。この結果、処理効率を向上させることができる。   According to this aspect of the present invention, when performing access processing to a specific shared access target, a dedicated thread that performs access processing to the specific shared access target is requested to perform access processing proxy. The thread that has requested access processing proxy can perform other general processing until the access processing ends. As a result, the processing efficiency can be improved.

本発明の一態様において、
前記複数のスレッドは、前記専用スレッドに前記特定の共有アクセス対象へのアクセス処理の代行を依頼する際に、前記専用スレッドが起動していない場合には前記専用スレッドの起動指示を行うと共に前記アクセス処理の代行に係るタスクの追加を行い、前記専用スレッドが起動している場合には前記アクセス処理の代行に係るタスクの追加を行うことを特徴とするものとしてもよい。
In one embodiment of the present invention,
The plurality of threads, when requesting the dedicated thread to perform access processing for the specific shared access target, if the dedicated thread is not activated, instructs the dedicated thread to start and the access It is also possible to add a task related to a proxy for processing and add a task related to the proxy for the access processing when the dedicated thread is activated.

また、本発明の一態様において、
前記複数のスレッド、及び前記専用スレッドに対する実行時間の割り当て比率を変更可能であることを特徴とするものとすると、好適である。
In one embodiment of the present invention,
It is preferable that the allocation ratio of execution time to the plurality of threads and the dedicated thread can be changed.

こうすれば、代行依頼されるアクセス処理が、どの程度の実行時間を要するのかに応じて、複数のスレッド、及び専用スレッドに対する実行時間の割り当て比率を適切に決定することができる。   By doing this, it is possible to appropriately determine the allocation ratio of execution time to a plurality of threads and dedicated threads according to how much execution time is required for the access process requested for the substitution.

この場合、
前記実行時間の割り当て比率の変更は、前記複数のスレッドのうち、前記特定の共有アクセス対象へのアクセス処理の代行を依頼するスレッドによって行われることを特徴とするものとすると、更に好適である。代行依頼されるアクセス処理が、どの程度の実行時間を要するのかを最もよく把握しているのは、当該代行依頼を行うスレッドだからである。
in this case,
It is more preferable that the change of the execution time allocation ratio is performed by a thread that requests substitution of access processing to the specific shared access target among the plurality of threads. It is the thread that makes the proxy request that best understands how long the access process requested by the proxy requires.

本発明によれば、処理効率を向上させることが可能なマルチスレッド処理装置を提供することができる。   According to the present invention, it is possible to provide a multithread processing apparatus capable of improving processing efficiency.

本発明の一実施例に係るマルチスレッド処理装置1のシステム構成例である。1 is a system configuration example of a multithread processing apparatus 1 according to an embodiment of the present invention. スレッド#1、#2、及びアクセス専用スレッド#kが、それぞれ複数のタスクを実行している状態を模式的に示す図である。FIG. 6 is a diagram schematically showing a state in which threads # 1, # 2 and an access dedicated thread #k are each executing a plurality of tasks. 各スレッドが、アクセス専用スレッド#kにアクセス処理の代行を依頼する際の処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process when each thread requests the access-dedicated thread #k to perform access process substitution. アクセス専用スレッド#kにより実行される処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process performed by the thread only for access #k. 従来のマルチスレッド処理装置による動作例を示す図である。It is a figure which shows the operation example by the conventional multithread processing apparatus. 本実施例のマルチスレッド処理装置1による動作例を示す図である。It is a figure which shows the operation example by the multithread processing apparatus 1 of a present Example. 本実施例のマルチスレッド処理装置1による他の動作例を示す図である。It is a figure which shows the other operation example by the multithread processing apparatus 1 of a present Example. 従来のマルチスレッド処理装置による動作例を示す図である。It is a figure which shows the operation example by the conventional multithread processing apparatus. 本実施例のマルチスレッド処理装置1による動作例を示す図である。It is a figure which shows the operation example by the multithread processing apparatus 1 of a present Example. 本実施例のマルチスレッド処理装置1による他の動作例を示す図である。It is a figure which shows the other operation example by the multithread processing apparatus 1 of a present Example.

以下、本発明を実施するための形態について、添付図面を参照しながら実施例を挙げて説明する。   DESCRIPTION OF EMBODIMENTS Hereinafter, embodiments for carrying out the present invention will be described with reference to the accompanying drawings.

以下、図面を参照し、本発明の一実施例に係るマルチスレッド処理装置1について説明する。   A multi-thread processing apparatus 1 according to an embodiment of the present invention will be described below with reference to the drawings.

[構成]
図1は、本発明の一実施例に係るマルチスレッド処理装置1のシステム構成例である。マルチスレッド処理装置1は、主要な構成として、プログラムメモリ10と、命令フェッチバス15と、命令フェッチユニット20と、命令バッファ22#1〜22#nと、命令デコーダ24と、命令発行部26と、レジスタ28#1〜28#nと、演算器30と、LSU32と、制御装置40と、特定共有アクセス対象50と、データバス55と、を備える。
[Constitution]
FIG. 1 is a system configuration example of a multithread processing apparatus 1 according to an embodiment of the present invention. The multi-thread processing apparatus 1 includes, as main components, a program memory 10, an instruction fetch bus 15, an instruction fetch unit 20, instruction buffers 22 # 1 to 22 # n, an instruction decoder 24, and an instruction issuing unit 26. , Registers 28 # 1 to 28 # n, an arithmetic unit 30, an LSU 32, a control device 40, a specific shared access target 50, and a data bus 55.

なお、本実施例では、二以上の任意の数であるスレッド数(後述するアクセス専用スレッドを含む)がnであるとし、「#」の後の数字がスレッドナンバーを示すものとする。また、図1に示す構成は、ハードウエア・マルチスレッディング処理を行うための一般的な構成を例示したものであり、ハードウエア・マルチスレッディング処理を行うことが可能な構成であれば、任意の構成要素を置換、削除、追加等してよい。   In this embodiment, it is assumed that the number of threads (including an access dedicated thread described later) that is an arbitrary number of 2 or more is n, and the number after “#” indicates the thread number. The configuration shown in FIG. 1 exemplifies a general configuration for performing hardware multithreading processing, and any configuration element can be used as long as it can perform hardware multithreading processing. Replace, delete, add, etc.

ハードウエア・マルチスレッディング処理とは、複数のスレッドが、命令デコーダや演算回路等のハードウエアの一部を共有して処理を行なうものである。スレッドとは、ハードウエアを部分的に共有して処理を行なう仮想的な処理主体をいう。本実施例では、命令バッファやレジスタはスレッド毎に用意されているが、その他の構成要素はスレッド間で共用されるものとする。   The hardware multithreading process is a process in which a plurality of threads share a part of hardware such as an instruction decoder and an arithmetic circuit. A thread is a virtual processing entity that performs processing while partially sharing hardware. In this embodiment, an instruction buffer and a register are prepared for each thread, but other components are shared between threads.

プログラムメモリ10は、例えばフラッシュROM(Read Only Memory)であり、各スレッドが実行するプログラム(命令列)を格納する。プログラムメモリ10は、命令フェッチユニット20から命令の格納場所を示すアドレスが入力されると、当該アドレスに格納された命令を出力する。   The program memory 10 is, for example, a flash ROM (Read Only Memory), and stores a program (instruction sequence) executed by each thread. When an address indicating the instruction storage location is input from the instruction fetch unit 20, the program memory 10 outputs the instruction stored at the address.

命令フェッチユニット20は、スレッド毎のプログラムカウンタを内蔵し、命令フェッチバス15を介してプログラムメモリ10から命令をフェッチし、命令バッファ22#1〜22#nのうち、スレッドに対応した命令バッファに格納する。   The instruction fetch unit 20 incorporates a program counter for each thread, fetches an instruction from the program memory 10 via the instruction fetch bus 15, and stores the instruction buffer corresponding to the thread among the instruction buffers 22 # 1 to 22 # n. Store.

すなわち、スレッド#1が実行する命令をフェッチした場合は命令バッファ22#1に命令を格納し、スレッド#2が実行する命令をフェッチした場合は命令バッファ22#2に命令を格納する。   That is, when an instruction executed by thread # 1 is fetched, the instruction is stored in instruction buffer 22 # 1, and when an instruction executed by thread # 2 is fetched, the instruction is stored in instruction buffer 22 # 2.

命令バッファ22#1〜22#nは、例えばFIFO(First In, First Out)に従って命令を入出力するように制御される。   The instruction buffers 22 # 1 to 22 # n are controlled to input / output instructions according to, for example, FIFO (First In, First Out).

命令デコーダ24は、いずれかの命令バッファから供給される命令を解読(デコード)し、命令発行部26に出力する。命令デコーダ24による解読結果は、例えば、演算の種別、ソースオペランド、結果の格納場所等である。   The instruction decoder 24 decodes (decodes) an instruction supplied from any instruction buffer and outputs the instruction to the instruction issuing unit 26. The result of decoding by the instruction decoder 24 is, for example, the type of operation, the source operand, the storage location of the result, and the like.

命令発行部26は、命令デコーダ24から入力された命令に従ってレジスタ28#1〜28#nから演算対象値等を取得し、演算器30やLSU32に出力する。   The instruction issuing unit 26 acquires the operation target value and the like from the registers 28 # 1 to 28 # n according to the instruction input from the instruction decoder 24, and outputs it to the arithmetic unit 30 and the LSU 32.

演算器30は、スレッドの要求に応じて、四則演算その他の演算処理を行う。一方、LSU32は、スレッドの要求に応じて、ストア命令やロード命令を実行する。   The arithmetic unit 30 performs four arithmetic operations and other arithmetic processes in response to a thread request. On the other hand, the LSU 32 executes a store instruction or a load instruction in response to a thread request.

制御装置40は、これらの動作全体を制御する。具体的には、内部クロックの立ち上がり等に応じて、命令フェッチユニット20、命令デコーダ24、命令発行部26、演算器30、LSU32等を作動させる。   The control device 40 controls these operations as a whole. Specifically, the instruction fetch unit 20, the instruction decoder 24, the instruction issuing unit 26, the arithmetic unit 30, the LSU 32, and the like are operated according to the rising edge of the internal clock.

また、制御装置40は、スレッドの切り替えを制御している。例えば、スレッド#1の処理を1クロック分行わせると、次にスレッド#2の処理を1クロック分行わせ、次にスレッド#1の処理を1クロック分行わせる等の切り替え制御を行っている。これらのスレッド処理時間の割り当ては、任意に設定することが可能であり、制御装置40は、その設定状態を保持するための設定保持用レジスタ42を内蔵するものとしてよい。   The control device 40 controls thread switching. For example, when the processing of the thread # 1 is performed for one clock, the switching control is performed such that the processing of the thread # 2 is performed for one clock and the processing of the thread # 1 is performed for one clock next. These thread processing time allocations can be arbitrarily set, and the control device 40 may incorporate a setting holding register 42 for holding the setting state.

特定共有アクセス対象50は、データバス55を介してLSU32等によりアクセスされる特定の機器群であり、例えばEEPROM(Electrically Erasable and Programmable Read Only Memory)やRAM(Random Access Memory)等のデータメモリ、I/O、CAN(Controller Area Network)コントローラ等が該当し得る。I/Oとは、例えばI/Oポートやその制御装置を含む。   The specific shared access target 50 is a specific device group accessed by the LSU 32 or the like via the data bus 55. For example, a data memory such as an EEPROM (Electrically Erasable and Programmable Read Only Memory) or a RAM (Random Access Memory), an I / O, CAN (Controller Area Network) controller, and the like may be applicable. The I / O includes, for example, an I / O port and its control device.

[アクセス代行依頼]
本実施例におけるスレッドは、複数のタスク(ある程度の機能的まとまりを有する命令群をいう)を、並行して、或いは所望の順序で実行可能となっている。
[Access proxy request]
The thread in this embodiment is capable of executing a plurality of tasks (indicating a group of instructions having a certain functional unit) in parallel or in a desired order.

ところで、スレッドが実行するタスクには、演算器30による演算を行ってレジスタ28#1〜28#nに格納する等、処理時間が比較的短く、且つデータバス55に対するアクセスを含まないものと、データバス55を介して特定共有アクセス対象50にアクセスする、処理時間の比較的長いものとが混在する。   By the way, the tasks executed by the thread include operations that are relatively short in processing time and do not include access to the data bus 55, such as performing calculations by the calculator 30 and storing them in the registers 28 # 1 to 28 # n. Access to the specific shared access target 50 via the data bus 55 and a relatively long processing time are mixed.

本実施例におけるスレッドは、特定共有アクセス対象50へのアクセス処理を行う際には、特定共有アクセス対象50へのアクセス処理を行う専用スレッドに、アクセス処理の代行を依頼する。以下、係る専用スレッドを「アクセス専用スレッド」と称する。   When performing the access process to the specific shared access target 50, the thread in this embodiment requests the dedicated thread that performs the access process to the specific shared access target 50 to perform the access process proxy. Hereinafter, such a dedicated thread is referred to as an “access dedicated thread”.

なお、図1では示していないが、特定共有アクセス対象50以外にも、データバス55その他のバスを介してアクセスするアクセス対象(以下、「非特定アクセス対象」と称する)が存在してもよく、この非特定アクセス対象について各スレッドは、アクセス専用スレッドにアクセス処理の代行を依頼しないものとしてよい。   Although not shown in FIG. 1, in addition to the specific shared access target 50, there may be an access target (hereinafter referred to as “non-specific access target”) accessed via the data bus 55 or other bus. For each non-specific access target, each thread may not request an access-dedicated thread for access processing.

非特定アクセス対象が存在する場合、種々のアクセス対象を、特定共有アクセス対象50と非特定アクセス対象のいずれとして扱うかは、システムの仕様に応じて任意に決定してよい。   When there are non-specific access targets, it may be arbitrarily determined depending on the system specifications whether to handle various access targets as the specific shared access target 50 or the non-specific access target.

図2は、スレッド#1、#2、及びアクセス専用スレッド#kが、それぞれ複数のタスクを実行している状態を模式的に示す図である。本図においてスレッド#1により実行されるタスク10、及びスレッド#2により実行されるタスク21は、特定共有アクセス対象50へのアクセス処理であり、スレッド#1により実行されるタスク11、及びスレッド#2により実行されるタスク20は、特定アクセス処理以外の処理である。以下、特定共有アクセス対象50へのアクセス処理を「特定アクセス処理」と称し、それ以外の処理を「一般処理」と称する。一般処理は、上記非特定アクセス対象へのアクセス処理を含むものとしてもよいし、含まないものとしてもよい。   FIG. 2 is a diagram schematically showing a state in which the threads # 1, # 2 and the access dedicated thread #k are each executing a plurality of tasks. In this figure, the task 10 executed by the thread # 1 and the task 21 executed by the thread # 2 are access processes to the specific shared access target 50, and the task 11 executed by the thread # 1 and the thread # 2 is a process other than the specific access process. Hereinafter, the access processing to the specific shared access target 50 is referred to as “specific access processing”, and the other processing is referred to as “general processing”. The general process may include an access process to the non-specific access target or may not include the general process.

図2において、破線矢印は、従来のマルチスレッド処理装置におけるデータアクセスを示している。従来のマルチスレッド処理では、各スレッドが独自に特定共有アクセス対象50へのアクセス処理を行っていた。このため、後述するように、無駄なクロックがスレッドに割り当てられ、処理効率が低下する場合があった。   In FIG. 2, broken line arrows indicate data access in the conventional multithread processing apparatus. In conventional multithread processing, each thread independently performs access processing to the specific shared access target 50. For this reason, as will be described later, useless clocks are assigned to threads, and processing efficiency may be reduced.

これに対し、本実施例のマルチスレッド処理装置では、アクセス専用スレッドでない各スレッドは(以下、「各スレッド」と表記した場合、アクセス専用スレッドを除外するものとする)、特定共有アクセス対象50へのアクセス処理を行う際にはアクセス専用スレッド#kにアクセス処理の代行を依頼し、アクセス専用スレッド#kのみが特定共有アクセス対象50へのアクセス処理を行うように制御される。図2における実線は、本実施例のマルチスレッド処理装置1におけるデータアクセスを示している。   On the other hand, in the multi-thread processing apparatus of this embodiment, each thread that is not an access dedicated thread (hereinafter referred to as “each thread” excludes an access dedicated thread) is transferred to the specific shared access target 50. When the access process is performed, the access dedicated thread #k is requested to perform the access process, and only the access dedicated thread #k is controlled to perform the access process to the specific shared access target 50. A solid line in FIG. 2 indicates data access in the multithread processing apparatus 1 of the present embodiment.

この結果、アクセス処理の代行を依頼したスレッドは、当該アクセス処理が終了するまでの間、他の一般処理を行うことができる。従って、処理効率を向上させることができる。   As a result, the thread that requested access processing proxy can perform other general processing until the access processing ends. Therefore, processing efficiency can be improved.

[処理フロー]
以下、各スレッドがアクセス専用スレッド#kにアクセス処理の代行を依頼する際の処理の流れ、及びアクセス専用スレッド#kにおける処理の流れについて説明する。
[Processing flow]
Hereinafter, the flow of processing when each thread requests the access dedicated thread #k to perform access processing proxy and the flow of processing in the access dedicated thread #k will be described.

図3は、各スレッドが、アクセス専用スレッド#kにアクセス処理の代行を依頼する際の処理の流れを示すフローチャートである。本フローは、各スレッドが特定共有アクセス対象50にアクセスしようとするタイミングで開始される。   FIG. 3 is a flowchart showing the flow of processing when each thread requests the access dedicated thread #k to perform access processing proxy. This flow is started when each thread tries to access the specific shared access target 50.

まず、各スレッドは、アクセス専用スレッド#kが起動済みであるか否かを判定する(S100)。   First, each thread determines whether or not the access dedicated thread #k has been activated (S100).

アクセス専用スレッドが起動済みでない場合は、アクセス専用スレッド#kを起動するように制御装置40に指示する(S102)。   If the access dedicated thread has not been activated, the controller 40 is instructed to activate the access dedicated thread #k (S102).

そして、自スレッド用のアクセス処理タスクを追加するようにアクセス専用スレッド#kに通知する(S104)。   Then, the access dedicated thread #k is notified to add an access processing task for the own thread (S104).

このように、各スレッドは、アクセス専用スレッド#kが起動済みでない場合はアクセス専用スレッド#kの起動及びタスクの追加を指示し、アクセス専用スレッド#kが既に起動済みである場合はタスクの追加のみを指示する。   In this way, each thread instructs activation of the access dedicated thread #k and addition of a task when the access dedicated thread #k has not been activated, and adds a task when the access dedicated thread #k has already been activated. Only instruct.

図4は、アクセス専用スレッド#kにより実行される処理の流れを示すフローチャートである。本フローは、アクセス専用スレッド#kに動作クロックが割り当てられた度に繰り返し実行される。   FIG. 4 is a flowchart showing a flow of processing executed by the access dedicated thread #k. This flow is repeatedly executed every time an operation clock is assigned to the access dedicated thread #k.

まず、当該動作クロックにおいて、実行中のアクセス処理タスクが終了したか否かを判定する(S200)。当該動作クロックにおいて、実行中のアクセス処理タスクが終了しなかった場合は、本フローの1ルーチンを終了する。   First, it is determined whether or not the access processing task being executed is completed in the operation clock (S200). If the access processing task being executed has not ended in the operation clock, one routine of this flow is ended.

実行中のアクセス処理タスクが終了した場合は、別のアクセス処理タスクが待ち状態となっているか否かを判定する(S202)。別のアクセス処理タスクが待ち状態となっている場合は、当該アクセス処理タスクを終了し、次回のルーチンでは待ち状態となっているアクセス処理タスクを実行する(S204)。   When the access processing task being executed is completed, it is determined whether another access processing task is in a waiting state (S202). If another access processing task is in a waiting state, the access processing task is terminated, and the access processing task in a waiting state is executed in the next routine (S204).

ここで、アクセス処理タスクは、アクセス専用スレッドが有する待ちキュー等に格納され、FIFOに従って順に実行されるものとしてもよいが、各タスクからの割り込み指示によって即時実行されるように設定することもできる。   Here, the access processing task may be stored in a waiting queue or the like possessed by the access-dedicated thread and executed in order according to the FIFO. However, the access processing task may be set to be executed immediately in response to an interrupt instruction from each task. .

一方、別のアクセス処理タスクが待ち状態となっていない場合は、当該アクセス処理タスクを終了すると共に、アクセス専用スレッド#k自体を終了する(S206)。   On the other hand, if another access processing task is not in a waiting state, the access processing task is terminated and the access dedicated thread #k itself is terminated (S206).

この際に、アクセス専用スレッド#kを終了するのではなく、アイドルタスクとして存続させてもよい(クロック割り当てを非常に低くして存続させる)。こうすれば、アクセス専用スレッド#kの起動及び終了に要する時間や負荷等を低減することができる。   At this time, instead of ending the access dedicated thread #k, it may be continued as an idle task (clock allocation is kept very low). In this way, it is possible to reduce the time and load required for starting and ending the access dedicated thread #k.

[動作比率の変更]
また、本実施例のマルチスレッド処理装置1では、アクセス処理の代行依頼、或いはアクセス専用スレッドの起動及び終了に伴って、スレッドの動作比率を任意に変更することができる。例えば、アクセス処理の代行が発生する以前にスレッド#1とスレッド#2が1:1で動作していたところ、クロック割り当てを余り必要としないアクセス処理の代行依頼が発生した場合には、スレッド#1とスレッド#2とアクセス専用スレッド#kの動作比率を1:1:1に設定し、クロック割り当てを多く必要とするアクセス処理の代行依頼が発生した場合には、スレッド#1とスレッド#2とアクセス専用スレッド#kの動作比率を1:1:3に設定する等してよい。こうすれば、装置全体の処理効率を維持すると共に、処理の順序性を確保することが可能となる。
[Change operation ratio]
Further, in the multi-thread processing device 1 of the present embodiment, the thread operation ratio can be arbitrarily changed in response to the access processing proxy request or the activation and termination of the access dedicated thread. For example, when the thread # 1 and the thread # 2 operate at 1: 1 before the access processing proxy occurs, and an access processing proxy request that does not require much clock allocation occurs, the thread # 1 When the operation ratio between the thread 1, thread # 2, and the access thread #k is set to 1: 1: 1, and an access processing proxy request requiring a large number of clock allocations occurs, the thread # 1 and the thread # 2 And the operation ratio of the access dedicated thread #k may be set to 1: 1: 3. In this way, it is possible to maintain the processing efficiency of the entire apparatus and ensure the order of processing.

係る動作比率の設定は、例えば設定保持用レジスタ42の内容を書き換えることによって可能となる。設定される動作比率は、アクセス処理の代行依頼を行うスレッドから制御装置40に通知され、制御装置40において、直ちに当該アクセス処理の代行が行われるならば通知された動作比率に従って設定保持用レジスタ42の内容を書き換え、待ち状態となるならば当該アクセス処理の代行が行われるタイミングで通知された動作比率に従って設定保持用レジスタ42の内容を書き換える。   The operation ratio can be set by rewriting the contents of the setting holding register 42, for example. The set operation ratio is notified to the control device 40 from the thread that performs the access processing proxy request. If the access processing is immediately performed in the control device 40, the setting holding register 42 according to the notified operation ratio. The contents of the setting holding register 42 are rewritten in accordance with the operation ratio notified at the timing when the access processing is performed.

[動作比較]
以下、従来のマルチスレッド処理装置との動作の相違について説明する。ここでは、図2と同じ前提条件を用いる。すなわち、スレッド#1により実行されるタスク10、及びスレッド#2により実行されるタスク21は、特定共有アクセス対象50へのアクセス処理であり、スレッド#1により実行されるタスク11、及びスレッド#2により実行されるタスク20は、特定アクセス処理以外の一般処理である。なお、従来のマルチスレッド処理装置においては「特定共有アクセス対象」等の概念は存在しないが、ここでは同列に記載するものとする。図5〜図10において、「指1」、「指2」と表記されている部分は、Write指示等の指示が行われることを示している。また、上線が付された数字で表記されている部分は、クロック時間の消費(単位は半クロック)を示している。また、「遊」と表記されている部分は、CPU処理が無駄に消費されていることを示している。すなわち、遊びクロックである。
[Operation comparison]
The difference in operation from the conventional multithread processing apparatus will be described below. Here, the same preconditions as in FIG. 2 are used. That is, the task 10 executed by the thread # 1 and the task 21 executed by the thread # 2 are access processing to the specific shared access target 50, and the task 11 executed by the thread # 1 and the thread # 2 The task 20 executed by is a general process other than the specific access process. In the conventional multi-thread processing apparatus, there is no concept such as “specific shared access target”, but it is described here in the same column. In FIGS. 5 to 10, portions indicated as “finger 1” and “finger 2” indicate that an instruction such as a write instruction is performed. A portion indicated by a number with an overline indicates consumption of clock time (unit: half clock). Further, the portion described as “play” indicates that CPU processing is wasted. That is, it is a play clock.

(クロック割り当ての必要性が低いアクセスに関して)
図5〜図7は、特定共有アクセス対象50がEEPROMやI/Oである場合のように、外部ペリフェラルの実行時間においてCPUの処理を必要としない時間が生じる場合の動作例、すなわち、アクセス処理タスクの実行に対するクロック割り当てを余り多くする必要がない場合の動作例を示している。
(For access with low clock allocation requirement)
5 to 7 show an operation example in the case where a time not requiring the CPU processing occurs in the execution time of the external peripheral as in the case where the specific shared access target 50 is an EEPROM or I / O, that is, the access processing The example of operation | movement in case it is not necessary to increase clock allocation with respect to execution of a task too much is shown.

より具体的には、図5〜7では、タスク10、21がEEPROM(図5〜7では「E2P」と略記した)に書き込みを行い、タスク11、20が一般処理を行うものとする。EEPROMへの書き込みは、Write指示に2クロックを要する他、13クロック分の時間を消費するものとする。但し、当該13クロック分の時間内において、アクセス処理タスクによる処理は不要である。   More specifically, in FIGS. 5 to 7, tasks 10 and 21 write to an EEPROM (abbreviated as “E2P” in FIGS. 5 to 7), and tasks 11 and 20 perform general processing. Writing to the EEPROM requires two clocks for the Write instruction and consumes 13 clocks. However, the processing by the access processing task is unnecessary within the time corresponding to 13 clocks.

図5は、従来のマルチスレッド処理装置による動作例を示している。   FIG. 5 shows an operation example of a conventional multithread processing apparatus.

まず、時刻T0において、タスク10によるEEPROMへのアクセスが開始される。上記のように、Write指示と、13クロック分の時間経過をもって、時刻T2に書き込み処理が終了する。この期間において、他タスクによるRAMへのアクセスは禁止される(排他区間)。この書き込み処理の間にも、タスク10にクロックが割り当てられ続けるため、遊びクロックが13クロック分生じることになる。   First, at time T0, the task 10 starts to access the EEPROM. As described above, the write process ends at time T2 with the write instruction and the passage of time of 13 clocks. During this period, access to the RAM by other tasks is prohibited (exclusive section). During this writing process, since a clock is continuously assigned to the task 10, 13 idle clocks are generated.

タスク10による書き込み処理の途中における時刻T1において、タスク21によるEEPROMへの書き込み要求がなされたものとする(図では「排他要求」と表記した)。この場合、タスク10による書き込み処理が終了するまでの間、タスク21は待ち状態となり、従って、スレッド#2全体が待ち状態となる。この待ち状態の間に、タスク21にクロックが割り当てられ続けるため、遊びクロックが10クロック分生じることになる。   Assume that a write request to the EEPROM by the task 21 is made at time T1 in the middle of the writing process by the task 10 (denoted as “exclusive request” in the figure). In this case, the task 21 is in a waiting state until the writing process by the task 10 is completed, and therefore the entire thread # 2 is in a waiting state. During this waiting state, since a clock is continuously assigned to the task 21, 10 idle clocks are generated.

時刻T2に至ると、タスク21によるEEPROMへのアクセスが開始される。Write指示と、13クロック分の時間経過をもって、時刻T3に書き込み処理が終了する。この書き込み処理の間に、タスク21にクロックが割り当てられ続けるため、遊びクロックが13クロック分生じることになる。   When the time T2 is reached, the task 21 starts to access the EEPROM. The write process ends at time T3 after the Write instruction and the time of 13 clocks have elapsed. During this writing process, the clock continues to be assigned to the task 21, so that 13 idle clocks are generated.

ここでタスク11は一般処理であるため、タスク21と並行して実行可能である。このため、時刻T2〜T3の間、タスク11は実行されている。タスク20に関しては、タスク21の終了後に実行が開始される。   Here, since the task 11 is a general process, it can be executed in parallel with the task 21. For this reason, the task 11 is executed during the time T2 to T3. With respect to the task 20, execution is started after the task 21 is completed.

これらの結果、図5に示す動作例において、遊びクロックは合計36クロック分、生じたことになる。   As a result, in the operation example shown in FIG. 5, a total of 36 clocks are generated.

図6は、本実施例のマルチスレッド処理装置1による動作例を示している。   FIG. 6 shows an operation example by the multithread processing apparatus 1 of the present embodiment.

本図では、アクセス専用スレッド#kが起動した後の、スレッド#1、スレッド#2、アクセス専用スレッド#kのクロック割り当て比率は、1:1:1に設定されるものとする。   In this figure, it is assumed that the clock allocation ratio of the thread # 1, the thread # 2, and the access dedicated thread #k after the access dedicated thread #k is activated is set to 1: 1: 1.

まず、時刻T10において、スレッド#1によりアクセス専用スレッドの起動指示、及び自己のためのアクセス処理タスク10*を追加するように指示がなされ、アクセス専用スレッド#kによるタスク10*がWrite指示を実行する。13クロック分の時間経過をもって、時刻T12に書き込み処理が終了する。この書き込み処理の間に、タスク10*にクロックが割り当てられ続けるが、図5に比してクロック割り当て比率が低下しているため、遊びクロックは8クロック分しか生じないことになる。   First, at time T10, an instruction to start an access dedicated thread and an access processing task 10 * for itself are issued by the thread # 1, and the task 10 * by the access dedicated thread #k executes a write instruction. To do. The writing process ends at time T12 when 13 clocks have elapsed. During this writing process, a clock continues to be assigned to the task 10 *. However, since the clock assignment ratio is lower than that in FIG. 5, only eight idle clocks are generated.

時刻T10と時刻T12の間において、スレッド#1はタスク11を実行することができる。ここでは、9クロック分の処理を経てタスク11の実行が終了するものとする。   Thread # 1 can execute task 11 between time T10 and time T12. Here, it is assumed that the execution of the task 11 is completed after processing for 9 clocks.

アクセス専用スレッドのタスク10*による書き込み処理の途中における時刻T11において、タスク21は、アクセス専用スレッド#kに対して、自己のためのアクセス処理タスク21*を追加するように指示する。この場合、タスク10*による書き込み処理が終了するまでの間、タスク21*は待ち状態となるが、スレッド#2は次のクロックから一般タスク20を開始することができる。ここでは、15クロック分の処理を経てタスク20の実行が終了するものとする。   At time T11 in the middle of the write process by the task 10 * for the access dedicated thread, the task 21 instructs the access dedicated thread #k to add the access processing task 21 * for itself. In this case, the task 21 * is in a waiting state until the writing process by the task 10 * is completed, but the thread # 2 can start the general task 20 from the next clock. Here, it is assumed that the execution of the task 20 is completed after processing for 15 clocks.

時刻T12に至ると、タスク21*によるEEPROMへのアクセスが開始される。Write指示と、13クロック分の時間経過をもって、時刻T13に書き込み処理が終了する。この書き込み処理の間に、タスク21にクロックが割り当てられ続けるため、遊びクロックが8クロック分生じることになる。   When the time T12 is reached, access to the EEPROM by the task 21 * is started. The write process ends at time T13 after the Write instruction and the passage of 13 clocks. During this write process, since a clock is continuously assigned to the task 21, eight idle clocks are generated.

これらの結果、図6に示す動作例において、遊びクロックは合計16クロック分、生じたことになり、従来のマルチスレッド処理装置に比して遊びクロックの発生が抑制されている。また、処理結果の観点からも、時刻T3において従来のマルチスレッド処理装置はタスク20が漸く開始した状態であるのに対し、時刻T3とほぼ同時刻である時刻T13において、本実施例のマルチスレッド処理装置1は、タスク20の処理を終了している。   As a result, in the operation example shown in FIG. 6, a total of 16 idle clocks are generated, and the generation of idle clocks is suppressed as compared with the conventional multi-thread processing apparatus. Also, from the viewpoint of processing results, the conventional multithread processing apparatus is in a state where the task 20 has started gradually at time T3, whereas at time T13, which is substantially the same time as time T3, The processing device 1 has finished the processing of the task 20.

これらより、本実施例のマルチスレッド処理装置1では、図5に動作例を示した従来のマルチスレッド処理装置に比して、処理効率が向上していることが分かる。   From these, it can be seen that the processing efficiency is improved in the multithread processing apparatus 1 of this embodiment as compared with the conventional multithread processing apparatus shown in FIG.

図7は、本実施例のマルチスレッド処理装置1による他の動作例を示している。   FIG. 7 shows another operation example by the multithread processing apparatus 1 of the present embodiment.

本図では、アクセス専用スレッド#kが起動した後の、スレッド#1、スレッド#2、アクセス専用スレッド#kのクロック割り当て比率は、2:2:1に設定されるものとする。すなわち、アクセス専用スレッド#kに割り当てるクロック比率を図6の動作例に比して低下させている。   In this figure, it is assumed that the clock allocation ratio of the thread # 1, the thread # 2, and the access dedicated thread #k after the access dedicated thread #k is activated is set to 2: 2: 1. That is, the clock ratio assigned to the access dedicated thread #k is reduced as compared with the operation example of FIG.

この場合、図6の動作例と、処理の実行順はほぼ同じとなる。クロック割り当て比率が低下するタスク10*、21*の処理が終了する時刻は図6の動作例に比して若干遅くなるが、タスク11、20による処理に、より多くのクロックを割り当てることが可能となる(それぞれ10クロック、19クロック分の処理が可能である様子を図示した)。また、遊びクロックの発生は、図6の動作例に比して少なく、合計10クロック分となっている。   In this case, the processing execution order is almost the same as the operation example of FIG. The time at which the processing of tasks 10 * and 21 * at which the clock allocation ratio decreases is slightly delayed compared to the operation example of FIG. 6, but more clocks can be allocated to the processing by tasks 11 and 20. (The figure shows that processing for 10 clocks and 19 clocks is possible, respectively). Further, the generation of idle clocks is less than that in the operation example of FIG.

(クロック割り当ての必要性が高いアクセスに関して)
図8〜図10は、特定共有アクセス対象50がRAMである場合のように、書き込みや読み出しについてCPUの処理を必要とする場合の動作例、すなわち、アクセス処理タスクの実行にクロック割り当てを多く必要とする場合の動作例を示している。
(For access with high clock allocation requirement)
8 to 10 are examples of operations when CPU processing is required for writing and reading as in the case where the specific shared access target 50 is RAM, that is, a large number of clock allocations are required to execute the access processing task. An example of the operation is shown.

より具体的には、図8〜10では、タスク10、21がRAMに書き込みを行い、タスク11、20が一般処理を行うものとする。RAMへの書き込みは、15クロック分の時間を消費するものとする。当該15クロック分の時間内においては、アクセス処理タスクによる処理が不要となる。   More specifically, in FIGS. 8 to 10, tasks 10 and 21 write to the RAM, and tasks 11 and 20 perform general processing. It is assumed that writing to the RAM consumes time for 15 clocks. In the time corresponding to the 15 clocks, processing by the access processing task becomes unnecessary.

図8は、従来のマルチスレッド処理装置による動作例を示している。   FIG. 8 shows an operation example of a conventional multithread processing apparatus.

まず、時刻T20において、タスク10によるRAMへのアクセスが開始される。上記のように、15クロック分の時間経過をもって、時刻T22に書き込み処理が終了する。この期間において、他タスクによるRAMへのアクセスは禁止される(排他区間)。   First, at time T20, access to the RAM by the task 10 is started. As described above, the writing process ends at time T22 after the elapse of 15 clocks. During this period, access to the RAM by other tasks is prohibited (exclusive section).

タスク10による書き込み処理の途中における時刻T21において、タスク21によるRAMへの書き込み要求がなされたものとする(図では「排他要求」と表記した)。この場合、タスク10による書き込み処理が終了するまでの間、タスク21は待ち状態となり、従って、スレッド#2全体が待ち状態となる。この待ち状態の間に、タスク21にクロックが割り当てられ続けるため、遊びクロックが10クロック分生じることになる。   It is assumed that a write request to the RAM by the task 21 is made at time T21 during the writing process by the task 10 (denoted as “exclusive request” in the figure). In this case, the task 21 is in a waiting state until the writing process by the task 10 is completed, and therefore the entire thread # 2 is in a waiting state. During this waiting state, since a clock is continuously assigned to the task 21, 10 idle clocks are generated.

時刻T22に至ると、タスク21によるRAMへのアクセスが開始される。15クロック分の時間経過をもって、時刻T23に書き込み処理が終了する。   When the time T22 is reached, access to the RAM by the task 21 is started. The writing process ends at time T23 with the passage of 15 clocks.

ここでタスク11は一般処理であるため、タスク21と並行して実行可能である。このため、時刻T22〜T23の間、タスク11は実行されている。タスク20に関しては、タスク21の終了後に実行が開始される。   Here, since the task 11 is a general process, it can be executed in parallel with the task 21. For this reason, the task 11 is being executed between times T22 and T23. With respect to the task 20, execution is started after the task 21 is completed.

これらの結果、図8に示す動作例において、遊びクロックは合計10クロック分、生じたことになる。   As a result, in the operation example shown in FIG. 8, a total of 10 idle clocks are generated.

図9は、本実施例のマルチスレッド処理装置1による動作例を示している。   FIG. 9 shows an operation example by the multithread processing apparatus 1 of the present embodiment.

本図では、アクセス専用スレッド#kが起動した後の、スレッド#1、スレッド#2、アクセス専用スレッド#kのクロック割り当て比率は、1:1:2に設定されるものとする。   In this figure, it is assumed that the clock allocation ratio of the thread # 1, the thread # 2, and the access dedicated thread #k after the access dedicated thread #k is activated is set to 1: 1: 2.

まず、時刻T30において、スレッド#1によりアクセス専用スレッドの起動指示、及び自己のためのアクセス処理タスク10*を追加するように指示がなされ、アクセス専用スレッド#kによるタスク10*がRAMへの書き込みを開始する。15クロック分の時間経過をもって、時刻T32に書き込み処理が終了する。   First, at time T30, an instruction to start an access dedicated thread and an access processing task 10 * for itself are issued by the thread # 1, and the task 10 * by the access dedicated thread #k writes to the RAM. To start. The writing process ends at time T32 after the elapse of 15 clocks.

時刻T30と時刻T32の間において、スレッド#1はタスク11を実行することができる。本図では、タスク11、20の実行に係るクロック数については省略する。   Thread # 1 can execute task 11 between time T30 and time T32. In this figure, the number of clocks related to the execution of tasks 11 and 20 is omitted.

アクセス専用スレッドのタスク10*による書き込み処理の途中における時刻T31において、タスク21は、アクセス専用スレッド#kに対して、自己のためのアクセス処理タスク21*を追加するように指示する。この場合、タスク10*による書き込み処理が終了するまでの間、タスク21*は待ち状態となるが、スレッド#2は次のクロックから一般タスク20を開始することができる。   At time T31 in the middle of the writing process by the task 10 * for the access dedicated thread, the task 21 instructs the access dedicated thread #k to add the access processing task 21 * for itself. In this case, the task 21 * is in a waiting state until the writing process by the task 10 * is completed, but the thread # 2 can start the general task 20 from the next clock.

時刻T32に至ると、タスク21*によるRAMへのアクセスが開始される。15クロック分の時間経過をもって、時刻T33に書き込み処理が終了する。   When the time T32 is reached, access to the RAM by the task 21 * is started. The writing process ends at time T33 with the passage of 15 clocks.

これらの結果、図9に示す動作例において、遊びクロックは生じないため、従来のマルチスレッド処理装置に比して遊びクロックの発生が抑制されている。また、処理結果の観点からも、時刻T23において従来のマルチスレッド処理装置はタスク20が漸く開始した状態であるのに対し、時刻T23とほぼ同時刻である時刻T33において、本実施例のマルチスレッド処理装置1は、タスク20の処理を11クロック分終了している。   As a result, since no idle clock is generated in the operation example shown in FIG. 9, the generation of the idle clock is suppressed as compared with the conventional multi-thread processing apparatus. Also, from the viewpoint of processing results, the conventional multithread processing apparatus is in a state where the task 20 has started gradually at time T23, whereas at time T33, which is substantially the same time as time T23, the multithread of this embodiment. The processing device 1 finishes the processing of the task 20 for 11 clocks.

これらより、本実施例のマルチスレッド処理装置1では、図8に動作例を示した従来のマルチスレッド処理装置に比して、処理効率が向上していることが分かる。   From these, it can be seen that the processing efficiency is improved in the multithread processing apparatus 1 of the present embodiment as compared with the conventional multithread processing apparatus shown in FIG.

図10は、本実施例のマルチスレッド処理装置1による他の動作例を示している。   FIG. 10 shows another operation example by the multithread processing apparatus 1 of the present embodiment.

本図では、アクセス専用スレッド#kが起動した後の、スレッド#1、スレッド#2、アクセス専用スレッド#kのクロック割り当て比率は、1:1:4に設定されるものとする。すなわち、アクセス専用スレッド#kに割り当てるクロック比率を図9の動作例に比して低下させている。   In this figure, it is assumed that the clock allocation ratio of the thread # 1, the thread # 2, and the access dedicated thread #k after the access dedicated thread #k is activated is set to 1: 1: 4. That is, the clock ratio assigned to the access dedicated thread #k is lowered as compared with the operation example of FIG.

この場合、図9の動作例と、処理の実行順はほぼ同じとなる。タスク11、20の処理が終了する時刻は図9の動作例に比して若干遅くなるが、タスク10*、21*による処理に、より多くのクロックを割り当てることが可能となる。また、遊びクロックは、図9の動作例と同様、発生しない。   In this case, the execution order of processing is almost the same as the operation example of FIG. The time at which the processing of tasks 11 and 20 ends is slightly later than the operation example of FIG. 9, but more clocks can be assigned to the processing by tasks 10 * and 21 *. Further, the idle clock is not generated as in the operation example of FIG.

また、図6、7の動作例と図9、10の動作例を比較すると、アクセス専用スレッドに割り当てられるクロックの比率が、図9、10の動作例の方が高くなっている。これは、書き込み等にクロックの割り当てが必要なアクセスと、そうでないアクセスでクロック割り当て比率を適切に設定している様子を示すものである。通常、実行されるアクセス処理においてクロック割り当てが多く必要であるか否かは、当該アクセス処理に係るタスクが把握しているため、前述のように、アクセス処理の代行依頼を行うスレッドから制御装置40にクロック割り当て比率が通知されると好適であるものとした。   Further, comparing the operation examples of FIGS. 6 and 7 with the operation examples of FIGS. 9 and 10, the ratio of clocks allocated to the access dedicated thread is higher in the operation examples of FIGS. This shows a state in which the clock allocation ratio is appropriately set for an access that requires clock allocation for writing or the like and an access that does not. Usually, the task related to the access process knows whether or not a large number of clock allocations are required in the access process to be executed. Therefore, as described above, the control device 40 starts from the thread that performs the access process proxy request. It is preferable that the clock allocation ratio is notified.

[まとめ]
以上説明した本実施例のマルチスレッド処理装置1によれば、特定共有アクセス対象50へのアクセス処理を行う際には、特定共有アクセス対象50へのアクセス処理を行うアクセス専用スレッド#kに、アクセス処理の代行を依頼するため、アクセス処理の代行を依頼したスレッドは、当該アクセス処理が終了するまでの間、他の一般処理を行うことができる。この結果、処理効率を向上させることができる。
[Summary]
According to the multithread processing device 1 of the present embodiment described above, when performing access processing to the specific shared access target 50, the access dedicated thread #k that performs access processing to the specific shared access target 50 is accessed. In order to request processing proxy, the thread that has requested access processing proxy can perform other general processing until the access processing ends. As a result, the processing efficiency can be improved.

また、複数のスレッド#1…やアクセス専用スレッド#kに対する実行時間の割り当て比率を変更可能となっているため、代行依頼されるアクセス処理が、どの程度の実行時間を要するのかに応じて、複数のスレッド#1…やアクセス専用スレッド#kに対する実行時間の割り当て比率を適切に決定することができる。   In addition, since the execution time allocation ratio for the plurality of threads # 1... And the access dedicated thread #k can be changed, a plurality of access processes requested for the substitution are performed depending on how much execution time is required. The allocation ratio of the execution time to the thread # 1... And the access dedicated thread #k can be appropriately determined.

更に、割り当て比率の決定は、代行依頼されるアクセス処理が、どの程度の実行時間を要するのかを最もよく把握している、当該代行処理を行うスレッドによってなされるため、実行時間の割り当て比率を、より適切に決定することができる。   Furthermore, since the determination of the allocation ratio is made by the thread that performs the proxy process that best knows how much execution time the access process requested for the proxy requires, the allocation ratio of the execution time is It can be determined more appropriately.

以上、本発明を実施するための最良の形態について実施例を用いて説明したが、本発明はこうした実施例に何等限定されるものではなく、本発明の要旨を逸脱しない範囲内において種々の変形及び置換を加えることができる。   The best mode for carrying out the present invention has been described above with reference to the embodiments. However, the present invention is not limited to these embodiments, and various modifications can be made without departing from the scope of the present invention. And substitutions can be added.

1 マルチスレッド処理装置
10 プログラムメモリ
15 命令フェッチバス
20 命令フェッチユニット
22#1〜22#n 命令バッファ
24 命令デコーダ
26 命令発行部
28#1〜28#n レジスタ
30 演算器
32 LSU
40 制御装置
50 特定共有アクセス対象
55 データバス
#1、#2、#k スレッド
DESCRIPTION OF SYMBOLS 1 Multithread processing apparatus 10 Program memory 15 Instruction fetch bus 20 Instruction fetch unit 22 # 1-22 # n Instruction buffer 24 Instruction decoder 26 Instruction issuing part 28 # 1-28 # n Register 30 Calculator 32 LSU
40 Control device 50 Specific shared access target 55 Data bus # 1, # 2, #k thread

Claims (4)

複数のスレッドによりハードウエア・マルチスレッディング処理が行われるマルチスレッド処理装置であって、
前記複数のスレッドは、特定の共有アクセス対象へのアクセス処理を行う際には、該特定の共有アクセス対象へのアクセス処理を行う専用スレッドに、前記特定の共有アクセス対象へのアクセス処理の代行を依頼することを特徴とする、
マルチスレッド処理装置。
A multi-thread processing device in which hardware multi-threading processing is performed by a plurality of threads,
When the plurality of threads perform an access process to a specific shared access target, a proxy thread that performs the access process to the specific shared access target is delegated to the specific shared access target. It is characterized by requesting,
Multi-thread processing unit.
請求項1に記載のマルチスレッド処理装置であって、
前記複数のスレッドは、前記専用スレッドに前記特定の共有アクセス対象へのアクセス処理の代行を依頼する際に、前記専用スレッドが起動していない場合には前記専用スレッドの起動指示を行うと共に前記アクセス処理の代行に係るタスクの追加を行い、前記専用スレッドが起動している場合には前記アクセス処理の代行に係るタスクの追加を行うことを特徴とする、
マルチスレッド処理装置。
The multi-thread processing apparatus according to claim 1,
The plurality of threads, when requesting the dedicated thread to perform access processing for the specific shared access target, if the dedicated thread is not activated, instructs the dedicated thread to start and the access Adding a task related to the proxy of the process, and adding the task related to the proxy of the access process when the dedicated thread is activated,
Multi-thread processing unit.
請求項1又は2に記載のマルチスレッド処理装置であって、
前記複数のスレッド、及び前記専用スレッドに対する実行時間の割り当て比率を変更可能であることを特徴とする、
マルチスレッド処理装置。
The multi-thread processing apparatus according to claim 1 or 2,
The allocation ratio of the execution time to the plurality of threads and the dedicated thread can be changed,
Multi-thread processing unit.
請求項3に記載のマルチスレッド処理装置であって、
前記実行時間の割り当て比率の変更は、前記複数のスレッドのうち、前記特定の共有アクセス対象へのアクセス処理の代行を依頼するスレッドによって行われることを特徴とする、
マルチスレッド処理装置。
The multi-thread processing apparatus according to claim 3,
The change in the execution time allocation ratio is performed by a thread that requests substitution of access processing to the specific shared access target among the plurality of threads.
Multi-thread processing unit.
JP2010261361A 2010-11-24 2010-11-24 Multithread processor Pending JP2012113487A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010261361A JP2012113487A (en) 2010-11-24 2010-11-24 Multithread processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010261361A JP2012113487A (en) 2010-11-24 2010-11-24 Multithread processor

Publications (1)

Publication Number Publication Date
JP2012113487A true JP2012113487A (en) 2012-06-14

Family

ID=46497645

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010261361A Pending JP2012113487A (en) 2010-11-24 2010-11-24 Multithread processor

Country Status (1)

Country Link
JP (1) JP2012113487A (en)

Similar Documents

Publication Publication Date Title
JP5411587B2 (en) Multi-thread execution device and multi-thread execution method
US9208113B2 (en) Deferred inter-processor interrupts
US20030158885A1 (en) Method and apparatus for controlling the processing priority between multiple threads in a multithreaded processor
US20080040730A1 (en) Event-based bandwidth allocation mode switching method and apparatus
JP6240745B2 (en) System and method for running multiple hypervisors
JP5498505B2 (en) Resolving contention between data bursts
JP2006343872A (en) Multithreaded central operating unit and simultaneous multithreading control method
JP2007133456A (en) Semiconductor device
US20150082082A1 (en) Information processing device, information processing method, and storage medium storing program for executing information processing method
CN105988400B (en) Microcontroller unit
Mische et al. How to enhance a superscalar processor to provide hard real-time capable in-order smt
US20180293095A1 (en) Semiconductor device
JP2006092042A (en) Information processor and context switching method
JP2007109057A (en) Processor
JP2011170619A (en) Multithread processor
WO2006129767A1 (en) Multithread central processing device and simultaneous multithreading control method
JP2009193378A (en) Vector processing device
US9946665B2 (en) Fetch less instruction processing (FLIP) computer architecture for central processing units (CPU)
JP2005521937A (en) Context switching method and apparatus in computer operating system
US7904703B1 (en) Method and apparatus for idling and waking threads by a multithread processor
JP2012113487A (en) Multithread processor
Ward Sharing non-processor resources in multiprocessor real-time systems
JP2011070290A (en) Data processor
US20150363227A1 (en) Data processing unit and method for operating a data processing unit
JP2010176403A (en) Multithread processor device