JP5324188B2 - Electronics - Google Patents
Electronics Download PDFInfo
- Publication number
- JP5324188B2 JP5324188B2 JP2008278700A JP2008278700A JP5324188B2 JP 5324188 B2 JP5324188 B2 JP 5324188B2 JP 2008278700 A JP2008278700 A JP 2008278700A JP 2008278700 A JP2008278700 A JP 2008278700A JP 5324188 B2 JP5324188 B2 JP 5324188B2
- Authority
- JP
- Japan
- Prior art keywords
- task
- processing unit
- exclusive
- processing
- interrupt
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Telephone Function (AREA)
Description
本発明は、複数のタスクを実行する電子機器に関する。 The present invention relates to an electronic device that executes a plurality of tasks.
従来、複数のタスクを実行する電子機器において、それぞれのタスクの競合を回避しつつ、共通のリソースにアクセス可能にするためには、排他処理を実装する必要がある。 Conventionally, in an electronic device that executes a plurality of tasks, in order to make it possible to access a common resource while avoiding competition between the tasks, it is necessary to implement an exclusive process.
排他処理は、電子機器内の複数のタスクを実行するソフトウェアにクリティカルセクションやセマフォを実装することで実現できる。また、特許文献1〜3に提案された技術を用いて排他処理を実行させることによっても実現することできる。 Exclusive processing can be realized by implementing critical sections and semaphores in software that executes multiple tasks in an electronic device. Moreover, it is realizable also by performing an exclusive process using the technique proposed by patent documents 1-3.
特許文献1には、複数のタスクを実行するときの優先度を可変にし、一のタスクがリソースにアクセスしている間は、この一のタスクの優先度を他のタスクより高くすることにより、他のタスクによる割り込み処理を防ぐ事によって排他処理を実行する技術が提案されている。
In
特許文献2及び3には、一のタスクがハードウェアからの割り込み処理を契機としてリソースにアクセスする場合、一のタスクがリソースにアクセスしている間は他のタスクによる割り込み処理を禁止し、リソースへのアクセスが終了した後に他のタスクの割り込み処理を有効にする技術が提案されている。
しかしながら、上述した特許文献1〜3の技術では、以下に示すような問題がある。図7及び図8は、従来の電子機器における処理の流れを示すシーケンス図である。図7に示すように、タスク120の書き込み処理と、タスク110の読み込み処理とを一対の処理Dとする。そして、処理D及びタスク120の書き込み処理を排他するために一の排他処理を実装すると、図8に示すように、タスク120はタスク110からの読み込み処理終了待ち、タスク110はタスク120の排他処理終了待ちとなる。このとき、タスク110とタスク120とは互いの処理の終了待ち状態となり、タスク110とタスク120とが動作しない状態(デッドロック)が発生してしまうことが想定される。
However, the techniques disclosed in
そこで、本発明は、複数のタスクに排他処理を実装しても、それぞれのタスクの処理の競合、及びデッドロックの発生を回避することができる電子機器を提供することを目的とする。 Accordingly, an object of the present invention is to provide an electronic device that can avoid the competition of processing of each task and the occurrence of deadlock even if exclusive processing is implemented in a plurality of tasks.
本発明に係る電子機器の制御方法は、上記課題を解決するために、第1のCPUにおいて、第1のタスク実行部により第1のタスク、及び前記第1のタスクよりも優先度が低い第2のタスクが実行され、第2のCPUにおいて、第2のタスク実行部により第3のタスクが実行される電子機器の制御方法において、ステップS1において、排他処理部は、前記第2のタスクにおける第1の排他処理の実行を開始し、ステップS2において、前記排他処理部は、前記第2のタスクにおける書き込み処理部による書き込み処理の開始前に、2回目の第1の排他処理の実行を開始し、ステップS3において、前記書き込み処理部は、第2のCPUの第3のタスクに対して書き込み処理を実行し、ステップS4において、前記排他処理部は、前記ステップS3における書き込み処理の終了に応じて、前記2回目の第1の排他処理を終了し、ステップS5において、待機処理部は、前記第1のタスクにおける読み込み処理の終了を待機する待機処理を実行し、ステップS6において、割り込み処理部は、前記第1のタスクに対して割り込み処理を実行し、ステップS7において、前記排他処理部は、前記ステップS6における割り込み処理に応じて、前記第1のタスクにおける読み込み処理部による読み込み処理の開始前に、前記第1の排他処理とは互いに干渉しない第2の排他処理の実行を開始し、ステップS8において、前記読み込み処理部は、第3のタスクからの読み込み処理を実行し、ステップS9において、前記読み込み処理部は、前記第1のタスクにおける読み込み処理の終了を前記第2のタスクへ通知し、ステップS10において、前記排他処理部は、前記第1のタスクにおける前記第2の排他処理を終了し、ステップS11において、前記排他処理部は、前記第2のタスクにおける前記第1の排他処理を終了することを特徴とする。 In order to solve the above-described problem, the electronic device control method according to the present invention has a first CPU that has a lower priority than the first task and the first task by the first task execution unit. In the electronic device control method in which the second task is executed by the second CPU and the third task is executed by the second task execution unit in the second CPU, the exclusive processing unit in the second task The execution of the first exclusive process is started, and in step S2, the exclusive process unit starts executing the second exclusive process before the start of the write process by the write process unit in the second task In step S3, the write processing unit executes write processing on the third task of the second CPU. In step S4, the exclusive processing unit executes the step. In response to the end of the write process in S3, the second first exclusive process ends, and in step S5, the standby processing unit executes a standby process that waits for the end of the read process in the first task. In step S6, the interrupt processing unit executes interrupt processing for the first task. In step S7, the exclusive processing unit determines whether the first task in the first task corresponds to the interrupt processing in step S6. Before starting the reading process by the reading processing unit, the execution of the second exclusive process that does not interfere with the first exclusive process is started. In step S8, the reading processing unit reads from the third task. In step S9, the read processing unit performs the end of the read process in the first task. In step S10, the exclusive processing unit terminates the second exclusive processing in the first task, and in step S11, the exclusive processing unit performs processing in the second task. The first exclusive process is terminated .
本発明に係る電子機器の制御方法は、上記課題を解決するために、第1のCPUにおいて、第1のタスク実行部により第1のタスク及び前記第1のタスクよりも優先度の低い第2のタスクが実行され、第2のCPUにおいて、第2のタスク実行部により第3のタスクが実行される電子機器の制御方法において、ステップS1において、排他処理部は、前記第2のタスクにおける第1の排他処理の実行を開始し、ステップS2において、前記排他処理部は、前記第2のタスクにおける書き込み処理部による書き込み処理の開始前に、第1の排他処理の実行を開始し、ステップS3において、前記書き込み処理部は、前記第2のCPUの第3のタスクに対して書き込み処理を実行し、同時に割り込み禁止処理部は、前記第1のタスクよりも優先度の低い第2のタスクにおいて、割り込み禁止処理を実行し、ステップS4において、前記排他処理部は、前記ステップS3における書き込み処理の終了に応じて、第1の排他処理を終了し、同時に前記割り込み禁止処理部は、前記第2のタスクにおける割り込み禁止処理を終了し、ステップS5において、待機処理部は、第1のタスクにおける読み込み処理の終了を待機する待機処理を実行し、ステップS6において、割り込み処理部は、前記第1のタスクに対して前記ステップS3の書き込み処理の終了後に、割り込み処理を実行し、ステップS7において、前記排他処理部は、前記ステップS6における割り込み処理に応じて、前記第1のタスクにおける読み込み処理部による読み込み処理の開始前に、前記第1の排他処理とは干渉しない第2の排他処理の実行を開始し、ステップS8において、前記読み込み処理部は、前記第3のタスクからの読み込み処理を実行し、ステップS9において、前記読み込み処理部は、前記第1のタスクにおける読み込み処理の終了を前記第2のタスクへ通知し、ステップS10において、前記排他処理部は、前記第1のタスクにおける第2の排他処理を終了し、ステップS11において、前記排他処理部は、前記第2のタスクにおける前記第1の排他処理を終了することを特徴とする。In order to solve the above-described problem, the electronic device control method according to the present invention uses the first task execution unit to lower the first task and the second lower priority than the first task in the first CPU. In the electronic device control method in which the second task is executed by the second CPU and the third task is executed by the second task execution unit in the second CPU, in step S1, the exclusive processing unit executes the second task in the second task. In step S2, the exclusive processing unit starts executing the first exclusive processing before starting the write processing by the write processing unit in the second task, and in step S3 The write processing unit executes a write process for the third task of the second CPU, and at the same time, the interrupt prohibition processing unit has a higher priority than the first task. In the second task that is low, interrupt prohibition processing is executed. In step S4, the exclusive processing unit ends the first exclusive processing in response to completion of the write processing in step S3, and at the same time the interrupt prohibition processing The unit ends the interrupt prohibition process in the second task, and in step S5, the standby processing unit executes a standby process waiting for the end of the reading process in the first task. In step S6, the interrupt processing unit Executes an interrupt process for the first task after the completion of the write process in step S3. In step S7, the exclusive processing unit performs the first task according to the interrupt process in step S6. Before starting the reading process by the reading processing unit in the task, it does not interfere with the first exclusive process. The execution of the second exclusive process is started. In step S8, the read processing unit executes the read process from the third task. In step S9, the read processing unit executes the read process in the first task. The end of the reading process is notified to the second task. In step S10, the exclusive processing unit ends the second exclusive process in the first task. In step S11, the exclusive processing unit The first exclusive process in the second task is terminated.
本発明に係る電子機器の制御方法は、上記課題を解決するために、第1のCPUにおいて、第1のタスク実行部により、第1のタスク、及び前記第1のタスクよりも優先度の低い第2のタスク、並びに前記第2のタスクよりもさらに優先度が低い第4のタスクが実行され、第2のCPUにおいて、第2のタスク実行部により第3のタスクが実行される電子機器の制御方法において、ステップS1において、排他処理部は、第2のタスクにおける書き込み処理部による書き込み処理の開始前に、第1の排他処理の実行を開始し、ステップS2において、前記書き込み処理部は、前記第2のタスクにおいて前記第2のCPUの前記第3のタスクに対して書き込み処理を実行し、同時に割り込み禁止処理部は、前記第1のタスクよりも優先度の低い前記第2のタスクにおいて割り込み禁止処理を実行し、ステップS3において、前記排他処理部は、前記第4のタスクにおいて第1の排他処理を開始し、ステップS4において、前記排他処理部は、前記第4のタスクにおいて、前記第1の排他処理とは互いに干渉しない第2の排他処理を開始し、ステップS5において、待機処理部は、前記第4のタスクにおいて待機処理を実行することにより、前記第2のタスクにおいて実行される前記第2の排他処理の終了を待機し、ステップS6において、前記排他処理部は、前記第2のタスクにおける前記第1の排他処理を終了し、待機処理部へ通知し、ステップS7において、描画処理部は、前記第2のタスクにおける前記第1の排他処理の終了通知に応じて、LCD制御部の第5のタスクに対して描画処理を実行し、ステップS8において、割り込み処理部は、前記第1のタスクに対して割り込み処理を実行し、ステップS9において、前記排他処理部は、前記第2の排他処理の実行を開始し、ステップS10において、前記待機処理部は、第1のタスクにおいて待機処理を実行することにより、第4のタスクにおける第2の排他処理の終了を待機し、ステップS11において、描画受信処理部は、前記ステップS7における描画処理に応じて、前記第5のタスクからの描画処理が終了したことの通知を受信し、ステップS12において、前記排他処理部は、前記第4のタスクにおける前記第2の排他処理を終了し、ステップS13において、前記排他処理部は、前記第4のタスクにおける前記第1の排他処理を終了し、ステップS14において、読み込み処理部は、前記第1のタスクにおける読み込み処理を実行することにより、前記第3のタスクからデータの読み込み処理を実行し、ステップS15において、前記排他処理部は、前記第1のタスクにおける前記第1の排他処理を終了する電子機器の制御方法。In order to solve the above problems, the electronic device control method according to the present invention has a lower priority than the first task and the first task by the first task execution unit in the first CPU. An electronic device in which a second task and a fourth task having a lower priority than the second task are executed, and in the second CPU, the third task is executed by the second task execution unit. In the control method, in step S1, the exclusive processing unit starts execution of the first exclusive processing before the start of the write processing by the write processing unit in the second task, and in step S2, the write processing unit In the second task, write processing is executed for the third task of the second CPU, and at the same time, the interrupt prohibition processing unit has a lower priority than the first task The interrupt prohibition process is executed in the second task. In step S3, the exclusive processing unit starts the first exclusive process in the fourth task. In step S4, the exclusive processing unit In task 4, the second exclusive process that does not interfere with the first exclusive process is started, and in step S5, the standby processing unit executes the standby process in the fourth task, thereby The exclusive processing unit waits for the end of the second exclusive process executed in the second task, and in step S6, the exclusive processing unit ends the first exclusive process in the second task and notifies the standby processing unit In step S7, the drawing processing unit responds to the fifth task of the LCD control unit in response to the end notification of the first exclusive processing in the second task. In step S8, the interrupt processing unit executes interrupt processing for the first task. In step S9, the exclusive processing unit starts executing the second exclusive processing. In step S10, the standby processing unit waits for the end of the second exclusive process in the fourth task by executing the standby process in the first task. In step S11, the drawing reception processing unit In response to the drawing process in step S7, a notification that the drawing process from the fifth task has been completed is received, and in step S12, the exclusion processing unit performs the second exclusion in the fourth task. In step S13, the exclusive processing unit ends the first exclusive process in the fourth task, and in step S14 In step S15, the read processing unit executes data read processing from the third task by executing read processing in the first task. In step S15, the exclusive processing unit executes the first task. A method of controlling an electronic device that ends the first exclusive process in FIG.
本発明によれば、複数のタスクに排他処理を実装しても、それぞれのタスクの処理の競合、及びデッドロックの発生を回避することができる電子機器を提供することができる。 According to the present invention, it is possible to provide an electronic device capable of avoiding contention of processing of each task and occurrence of deadlock even if exclusive processing is implemented in a plurality of tasks.
以下、本発明の実施の形態について説明する。図1は、本発明に係る携帯電子機器の一例である携帯電話機1の外観斜視図を示す。なお、図1は、いわゆる折り畳み型の携帯電話機の形態を示しているが、本発明に係る携帯電話機の形態としては特にこれに限られない。例えば、両筐体を重ね合わせた状態から一方の筐体を一方向にスライドさせるようにしたスライド式や、重ね合せ方向に沿う軸線を中心に一方の筐体を回転させるようにした回転式(ターンタイプ)や、操作部と表示部とが一つの筐体に配置され、連結部を有さない形式(ストレートタイプ)でもよい。
Embodiments of the present invention will be described below. FIG. 1 is an external perspective view of a
携帯電話機1は、操作部側筐体部2と、表示部側筐体部3と、を備えて構成される。操作部側筐体部2は、表面部に、操作部11と、携帯電話機1の使用者が通話時に発した音声が入力されるマイク12と、を備える。操作部11は、各種設定や電話帳機能やメール機能等の各種機能を作動させるための機能設定操作キー13と、電話番号の数字やメール等の文字等を入力するための入力操作キー14と、各種操作における決定やスクロール等を行う決定操作キー15と、から構成されている。
The
また、表示部側筐体部3は、表面部に、各種情報を表示するためのLCD(Liquid Crystal Display)表示部21と、通話の相手側の音声を出力するスピーカ22と、を備える。
Further, the display unit
また、操作部側筐体部2の上端部と表示部側筐体部3の下端部とは、ヒンジ機構4を介して連結されている。また、携帯電話機1は、ヒンジ機構4を介して連結された操作部側筐体部2と表示部側筐体部3とを相対的に回転することにより、操作部側筐体部2と表示部側筐体部3とが互いに開いた状態(開放状態)にしたり、操作部側筐体部2と表示部側筐体部3とを折り畳んだ状態(折畳み状態)にしたりできる。
Further, the upper end of the operation
また、操作部側筐体部2は、外平面部に、時計やメールの着信等が表示されるサブLCD表示部30が備えられている。
Further, the operation unit
図2は、携帯電話機1の機能を示す機能ブロック図である。携帯電話機1は、図2に示すように、操作部11(入力部)と、マイク12と、メインアンテナ40と、RF回路部41と、LCD制御部42と、音声処理部43と、メモリ44(記憶部)と、制御部45と、が操作部側筐体部2に備えられ、LCD表示部21(表示部)と、スピーカ22と、ドライバIC23と、サブLCD表示部30とが表示部側筐体部3に備えられている。
FIG. 2 is a functional block diagram showing functions of the
メインアンテナ40は、第1の使用周波数帯(例えば、800MHz)で基地局等と通信を行い、GPS通信のための第2の使用周波数帯(例えば、1.5GHz)に対応できるデュアルバンド対応構成である。なお、本実施の形態では、第1の使用周波数帯として、800MHzとしたが、これ以外の周波数帯であってもよい。また、メインアンテナ40は、第1の使用周波数帯で外部装置と通信を行い、GPS通信のための第2の使用周波数帯に対応できるアンテナを別途設けてもよい。
The
RF回路部41は、メインアンテナ40によって受信した信号を復調処理し、処理後の信号を制御部45に供給する。そして、制御部45から供給された信号を変調処理し、メインアンテナ40を介して外部装置(基地局)に送信する。また、その一方で、メインアンテナ40によって受信している信号の強度を制御部45に通知する。
The RF circuit unit 41 demodulates the signal received by the
LCD制御部42は、制御部45の制御にしたがって、所定の画像処理を行い、処理後の画像データをドライバIC23に出力する。ドライバIC23は、LCD制御部42から供給された画像データをフレームメモリに蓄え、所定のタイミングでLCD表示部21又はサブLCD表示部30に出力する。
The
音声処理部43は、制御部45の制御にしたがって、RF回路部41から供給された信号に対して所定の音声処理を行い、処理後の信号をスピーカ22に出力する。スピーカ22は、音声処理部43から供給された信号を外部に出力する。
The sound processing unit 43 performs predetermined sound processing on the signal supplied from the RF circuit unit 41 under the control of the
また、音声処理部43は、制御部45の制御にしたがって、マイク12から入力された信号を処理し、処理後の信号をRF回路部41に出力する。RF回路部41は、音声処理部43から供給された信号に所定の処理を行い、処理後の信号をメインアンテナ40に出力する。
In addition, the audio processing unit 43 processes the signal input from the
メモリ44は、例えば、ワーキングメモリを含み、制御部45による演算処理に利用される。また、メモリ44には、複数のアプリケーションや当該アプリケーションが必要とする各種のテーブルや各種情報等が記憶されている。また、メモリ44は、着脱可能な外部メモリを兼ねていてもよい。
The memory 44 includes, for example, a working memory and is used for arithmetic processing by the
制御部45は、携帯電話機1の全体を制御しており、中央処理装置(CPU)等を用いて構成される。
The
図3は、制御部45及びLCD制御部42の機能及び動作について示す機能ブロック図である。図3に示すように、制御部45は、少なくとも、ベースバンド用のCPUであるCPU451と、ワンセグデータのデコード機能や画像処理、表示処理、カメラ機能に関する処理等を実行するコプロセッサであるCPU452とを含んで構成される。
FIG. 3 is a functional block diagram showing functions and operations of the
LCD制御部42は、CPU452を基準としてCPU451とは反対側に配置され、CPU451とCPU452とは、共通のデータバス50を用いて通信を行い、また、CPU452と、LCD制御部42とは、共通のデータバス51を用いて通信を行う。
The
すなわち、CPU451に対するCPU452及びLCD制御部42は、CPU451から共通にアクセスし、CPU451へ共通にアクセスされるリソースであるといえる。以下、リソースとしてのCPU452及びLCD制御部42をリソース60という。
That is, it can be said that the CPU 452 and the
このように、本実施形態の制御部45により実行される複数のタスクには、これら複数のタスクからのリソース60への同時アクセスによる競合の発生を防ぐために、各々のタスクに排他処理を実行させることが必要となる。
As described above, the plurality of tasks executed by the
CPU451は、複数のタスクを並行して実行するタスク実行部461と、複数のタスクに所定の処理を実行する処理部462と、複数のタスクに排他処理を実行する排他処理部463と、複数のタスクに割り込み禁止処理を実行する割り込み禁止処理部464とを備える。
The CPU 451 includes a
CPU452は、タスクを実行するタスク実行部481と、所定の処理を実行する処理部491とを備える。また、処理部491は、CPU451へ割り込み処理を実行する割り込み処理部491を備える。
The CPU 452 includes a
タスク実行部461は、複数のタスクの実行を管理し、これら複数のタスクを並行して実行する。また、複数のタスクのそれぞれには、タスク実行部461により実行される際の優先度が予め設定され、メモリ44に記憶されている。
The
処理部462は、タスク実行部461により複数のタスクが実行される際、これら複数のタスクに共通なリソース60へデータの送受信を実行する。
When a plurality of tasks are executed by the
また、処理部462は、一のタスクからリソース60へデータの書き込み処理を実行する書き込み処理部471と、リソース60からのデータの読み込み処理を実行する読み込み処理部472と、リソース60による処理の終了を待機するための待機処理を実行する待機処理部473と、一のタスクにおいてリソース60へデータを送信する送信処理を実行する送信処理部474と、送信処理部474によるデータの送信に応じて、リソース60からデータを受信する受信処理を実行する受信処理部475と、リソース60に対して描画処理を実行する描画処理部476と、描画処理部476による描画処理に応じて、リソース60からデータを受信する受信処理を実行する描画受信処理部477と備える。
Further, the
排他処理部463は、処理部462により複数のタスクがリソース60データの送受信を行う場合、これら複数のタスクのそれぞれに互いに異なる排他処理を実行する。
When a plurality of tasks perform transmission / reception of the
そして、割り込み禁止処理部464は、タスク実行部461により実行される際の優先度が、複数のタスクのうちの他のタスクより一のタスクが低い(以降、「他のタスク>一のタスク」と表現することがある)場合、一のタスクにおいて、割り込み処理部491によるリソース60からの割り込み処理を禁止する割り込み禁止処理を実行する。
Then, the interrupt
そして、排他処理部463は、一のタスクにおいて送信処理部474によるリソース60への送信処理と、受信処理部475によるリソース60からの受信処理とが実行される場合、一のタスクにおいて実行される排他処理に加えて、更に異なる排他処理を一のタスクにおいて実行する。
The
また、排他処理部463は、書き込み処理部471による書き込み処理と待機処理部473による待機処理とが実行される第1のタスクと、割り込み処理部491による割り込み処理に応じて、読み込み処理部472による読み込み処理を実行する第2のタスクとのそれぞれに互いに異なる排他処理を実行する。
In addition, the
そして、割り込み禁止処理部464は、タスク実行部461により実行される際の優先度が第2のタスクよりも第1のタスクが低い(第2のタスク>第1のタスク)場合、第1のタスクにおいて割り込み禁止処理を実行する。
Then, the interrupt
そして、排他処理部463は、複数のタスクのうちの第3のタスクにおいて描画処理部476による描画処理と、描画受信処理部477による受信処理とが実行される場合、第3のタスクにおいて実行される排他処理に加えて、更に異なる排他処理を実行する。
The
次に、本発明に係る第1実施形態〜第3実施形態について説明する。 Next, the first to third embodiments according to the present invention will be described.
<第1実施形態>
図4は、本発明の第1実施形態に係る制御部45の処理の流れを示すシーケンス図である。第1実施形態では、CPU451において、タスク実行部461によりタスク100及びタスク110が実行され、CPU452において、タスク実行部481によりタスク200が実行される。また、タスク実行部461によりタスクが実行される際の優先度は、「タスク100>タスク110」と設定されている。
<First Embodiment>
FIG. 4 is a sequence diagram showing a process flow of the
ステップS1において、排他処理部463は、タスク110における排他処理Aの実行を開始する。
In step S <b> 1, the
ステップS2において、排他処理部463は、タスク110における書き込み処理部471による書き込み処理の開始前に、排他処理Aの実行を開始する。このとき、ステップS1での排他処理Aの開始と重複するが、同一タスク上での処理であるため、無視される。
In step S <b> 2, the
ステップS3において、書き込み処理部471は、CPU452のタスク200に対して書き込み処理を実行する。
In step S <b> 3, the
ステップS4において、排他処理部463は、ステップS3における書き込み処理の終了に応じて、排他処理Aを終了する。
In step S4, the
ステップS5において、待機処理部473は、タスク100における読み込み処理の終了を待機する待機処理を実行する。
In step S <b> 5, the
ステップS6において、割り込み処理部491は、タスク100に対して割り込み処理を実行する。
In step S <b> 6, the interrupt
ステップS7において、排他処理部463は、ステップS6における割り込み処理に応じて、タスク100における読み込み処理部472による読み込み処理の開始前に、排他処理Bの実行を開始する。
In step S7, the
ステップS8において、読み込み処理部472は、タスク200からの読み込み処理を実行する。
In step S <b> 8, the
ステップS9において、読み込み処理部472は、タスク100における読み込み処理の終了をタスク110へ通知する。
In step S <b> 9, the
ステップS10において、排他処理部463は、タスク100における排他処理Bを終了する。
In step S <b> 10, the
ステップS11において、排他処理部463は、タスク110における排他処理Aを終了する。
In step S <b> 11, the
このように第1実施形態の携帯電話機1によれば、排他処理部463は、割り込み処理に応じて読み込み処理が実行されるタスク100と、書き込み処理と待機処理とが実行されるタスク110とで互いに異なる排他処理を実行する。
As described above, according to the
これにより、排他処理Aと排他処理Bとは互いに干渉しないため、タスク110において排他処理Aを開始した後に、タスク110よりも優先度の高いタスク100において排他処理Bを開始した場合であっても、タスク100の処理が停止することなく、タスク100における読み込み処理が実行される。そして、タスク100における読み込み処理の終了によりタスク110の待機処理を終了させることが可能となり、デッドロックの発生を回避することができる。 Thus, the exclusion process A and the exclusion process B do not interfere with each other. Therefore, even after the exclusion process A is started in the task 110, the exclusion process B is started in the task 100 having a higher priority than the task 110. The reading process in the task 100 is executed without stopping the process in the task 100. Then, the waiting process of the task 110 can be ended by the end of the reading process in the task 100, and the occurrence of a deadlock can be avoided.
<第2実施形態>
図5は、第2実施形態に係る制御部45の処理の流れを示すシーケンス図である。第2実施形態も第1実施形態と同様に、CPU451において、タスク実行部461によりタスク100及びタスク110が実行され、CPU452において、タスク実行部481によりタスク200が実行される。また、タスク実行部461によりタスクが実行される際の優先度は、「タスク100>タスク110」と設定されている。
Second Embodiment
FIG. 5 is a sequence diagram showing a flow of processing of the
ステップS21において、排他処理部463は、タスク110における排他処理Aの実行を開始する。
In step S <b> 21, the
ステップS22において、排他処理部463は、タスク110における書き込み処理部471による書き込み処理の開始前に、排他処理Aの実行を開始する。このとき、ステップS21での排他処理Aの開始と重複するが、同一タスク上での処理であるため、無視される。
In step S <b> 22, the
ステップS23において、書き込み処理部471は、CPU452のタスク200に対して書き込み処理を実行する。また、同時に割り込み禁止処理部464は、タスク100よりも優先度の低いタスク110において、割り込み禁止処理を実行する。
In step S <b> 23, the
ステップS24において、排他処理部463は、ステップS23における書き込み処理の終了に応じて、排他処理Aを終了する。また、同時に割り込み禁止処理部464は、タスク110における割り込み禁止処理を終了する。
In step S24, the
ステップS25において、待機処理部473は、タスク100における読み込み処理の終了を待機する待機処理を実行する。
In step S <b> 25, the
ステップS26において、割り込み処理部491は、タスク100に対して割り込み処理を実行する。ここで、割り込み処理部491は、ステップS23の書き込み処理中には、タスク110に割り込み禁止処理が実行されているため、ステップS23の書き込み処理の終了後に、割り込み処理を実行する。
In step S <b> 26, the interrupt
ステップS27において、排他処理部463は、ステップS26における割り込み処理に応じて、タスク100における読み込み処理部472による読み込み処理の開始前に、排他処理Bの実行を開始する。
In step S27, the
ステップS28において、読み込み処理部472は、タスク200からの読み込み処理を実行する。
In step S <b> 28, the
ステップS29において、読み込み処理部472は、タスク100における読み込み処理の終了をタスク110へ通知する。
In step S <b> 29, the
ステップS30において、排他処理部463は、タスク100における排他処理Bを終了する。
In step S <b> 30, the
ステップS31において、排他処理部463は、タスク110における排他処理Aを終了する。
In step S <b> 31, the
このように第2実施形態の携帯電話機1によれば、排他処理部463により、タスク100と、タスク110とで互いに異なる排他処理を実行することに加え、割り込み禁止処理部464は、タスク100よりも優先度の低いタスク110において、タスク200からの割り込みを禁止する割り込み禁止処理を実行する。
As described above, according to the
これにより、タスク110における書き込み処理中は、タスク200からの割り込み処理が禁止されるため、タスク110におけるタスク200への書き込み処理中に、タスク100におけるタスク200からの読み込み処理を排他することができ、タスク100とタスク110とで処理が競合することを回避することができる。 As a result, interrupt processing from the task 200 is prohibited during the write processing in the task 110, so that the read processing from the task 200 in the task 100 can be excluded during the write processing to the task 200 in the task 110. Thus, it is possible to avoid a process conflict between the task 100 and the task 110.
<第3実施形態>
図6は、第3実施形態に係る制御部45の処理の流れを示すシーケンス図である。第3実施形態は、第1及び第2実施形態に加えて、タスク実行部461によりタスク120が実行される点が第1及び第2実施形態とは異なる。また、タスク実行部461によりタスクが実行される際の優先度は、「タスク100>タスク110>タスク120」と設定されている。
<Third Embodiment>
FIG. 6 is a sequence diagram showing a flow of processing of the
ステップS41において、排他処理部463は、タスク110における書き込み処理部471による書き込み処理の開始前に、排他処理Aの実行を開始する。
In step S <b> 41, the
ステップS42において、書き込み処理部471は、タスク110においてCPU452のタスク200に対して書き込み処理を実行する。また、同時に割り込み禁止処理部464は、タスク100よりも優先度の低いタスク110において割り込み禁止処理を実行する。
In step S <b> 42, the
ステップS43において、排他処理部463は、タスク120において排他処理Aを開始する。
In step S 43, the
ステップS44において、排他処理部463は、タスク120において排他処理Bを開始する。
In step S <b> 44, the
ステップS45において、待機処理部473は、タスク120において待機処理を実行する。このとき、待機処理部473は、タスク110において実行される排他処理Bの終了を待機する。
In step S <b> 45, the
ステップS46において、排他処理部463は、タスク110における排他処理Aを終了し、待機処理部473へ通知する。
In step S <b> 46, the
ステップS47において、描画処理部476は、タスク110における排他処理Aの終了通知に応じて、LCD制御部42のタスク300に対して描画処理を実行する。
In step S <b> 47, the
ステップS48において、割り込み処理部491は、タスク100に対して割り込み処理を実行する。
In step S <b> 48, the interrupt
ステップS49において、排他処理部463は、排他処理Bの実行を開始する。
In step S49, the
ステップS50において、待機処理部473は、タスク100において待機処理を実行する。このとき、待機処理部473は、タスク120における排他処理Bの終了を待機する。
In step S50, the
ステップS51において、描画受信処理部477は、ステップS47における描画処理に応じて、タスク300からの描画処理が終了したことの通知を受信する。
In step S51, the drawing
ステップS52において、排他処理部463は、タスク120における排他処理Bを終了する。
In step S <b> 52, the
ステップS53において、排他処理部463は、タスク120における排他処理Aを終了する。
In step S53, the
ステップS54において、読み込み処理部472は、タスク100における読み込み処理を実行する。このとき、読み込み処理部472は、タスク200からデータの読み込み処理を実行する。
In step S <b> 54, the
ステップS55において、排他処理部463は、タスク100における排他処理Aを終了する。
In step S <b> 55, the
このように第3実施形態の携帯電話機1によれば、排他処理部463は、タスク120において描画処理部476による描画処理と、描画受信処理部477による受信処理とが実行される場合、タスク120において、排他処理Aに加えて排他処理Bを実行する。
As described above, according to the
これにより、タスク110における書き込み処理中には、排他処理Aと、割り込み禁止処理が実行される。また、タスク100における読み込み処理中には、排他処理Bが実行される。また、タスク120における描画処理中には、排他処理Aと排他処理Bとが実行される。 Thereby, during the writing process in the task 110, the exclusion process A and the interrupt prohibition process are executed. Further, during the reading process in the task 100, the exclusive process B is executed. Further, during the drawing process in the task 120, the exclusive process A and the exclusive process B are executed.
したがって、これらのタスク100における読み込み処理、タスク110における書き込み処理、及びタスク120における描画処理が同時に実行されて、処理が競合することを回避できる。 Therefore, it is possible to avoid conflicting processing by simultaneously executing the reading process in the task 100, the writing process in the task 110, and the drawing process in the task 120.
以上、好適な実施形態について説明したが、本発明は上述した実施形態に限定されることなく種々の形態で実施することができる。例えば、本実施形態において、携帯電子機器として携帯電話機1について説明しているが、これに限定されず、PHS(登録商標;Personal Handy phone System)、PDA(Personal Digital Assistant)、ポータブルナビゲーション装置、ノートパソコン等であってもよい。
As mentioned above, although preferred embodiment was described, this invention can be implemented with a various form, without being limited to embodiment mentioned above. For example, in the present embodiment, the
また、上述の実施形態では、CPU451は、ベースバンド用のCPUであり、CPU452は、コプロセッサであり、また、リソース60は、CPU452とLCD制御部42とで構成されたが、これに限らず、他の機能及び動作を行うCPUを用いて構成してもよい。
In the above-described embodiment, the CPU 451 is a baseband CPU, the CPU 452 is a coprocessor, and the
1 携帯電話機
42 LCD制御部
45 制御部
60 リソース
461 タスク実行部
462 処理部462
463 排他処理部
DESCRIPTION OF
463 Exclusive processing part
Claims (3)
第2のCPUにおいて、第2のタスク実行部により第3のタスクが実行される電子機器の制御方法において、In the second CPU, in the control method of the electronic device in which the third task is executed by the second task execution unit,
ステップS1において、排他処理部は、前記第2のタスクにおける第1の排他処理の実行を開始し、In step S1, the exclusive processing unit starts execution of the first exclusive process in the second task,
ステップS2において、前記排他処理部は、前記第2のタスクにおける書き込み処理部による書き込み処理の開始前に、2回目の第1の排他処理の実行を開始し、In step S2, the exclusive processing unit starts executing the first exclusive processing for the second time before the write processing by the write processing unit in the second task is started,
ステップS3において、前記書き込み処理部は、第2のCPUの第3のタスクに対して書き込み処理を実行し、In step S3, the write processing unit executes a write process for the third task of the second CPU,
ステップS4において、前記排他処理部は、前記ステップS3における書き込み処理の終了に応じて、前記2回目の第1の排他処理を終了し、In step S4, the exclusive processing unit ends the second first exclusive process in response to the end of the writing process in step S3,
ステップS5において、待機処理部は、前記第1のタスクにおける読み込み処理の終了を待機する待機処理を実行し、In step S5, the standby processing unit executes a standby process for waiting for the end of the reading process in the first task,
ステップS6において、割り込み処理部は、前記第1のタスクに対して割り込み処理を実行し、In step S6, the interrupt processing unit executes interrupt processing for the first task,
ステップS7において、前記排他処理部は、前記ステップS6における割り込み処理に応じて、前記第1のタスクにおける読み込み処理部による読み込み処理の開始前に、前記第1の排他処理とは互いに干渉しない第2の排他処理の実行を開始し、In step S7, in response to the interrupt processing in step S6, the exclusion processing unit does not interfere with the first exclusion processing before the reading processing by the reading processing unit in the first task is started. Start exclusive processing of
ステップS8において、前記読み込み処理部は、第3のタスクからの読み込み処理を実行し、In step S8, the read processing unit executes a read process from the third task,
ステップS9において、前記読み込み処理部は、前記第1のタスクにおける読み込み処理の終了を前記第2のタスクへ通知し、In step S9, the reading processing unit notifies the second task of the end of the reading process in the first task,
ステップS10において、前記排他処理部は、前記第1のタスクにおける前記第2の排他処理を終了し、In step S10, the exclusive processing unit ends the second exclusive processing in the first task,
ステップS11において、前記排他処理部は、前記第2のタスクにおける前記第1の排他処理を終了する電子機器の制御方法。In step S11, the exclusive processing unit controls the electronic device to end the first exclusive processing in the second task.
第2のCPUにおいて、第2のタスク実行部により第3のタスクが実行される電子機器の制御方法において、In the second CPU, in the control method of the electronic device in which the third task is executed by the second task execution unit,
ステップS1において、排他処理部は、前記第2のタスクにおける第1の排他処理の実行を開始し、In step S1, the exclusive processing unit starts execution of the first exclusive process in the second task,
ステップS2において、前記排他処理部は、前記第2のタスクにおける書き込み処理部による書き込み処理の開始前に、第1の排他処理の実行を開始し、In step S2, the exclusive processing unit starts executing the first exclusive process before the start of the write process by the write processing unit in the second task,
ステップS3において、前記書き込み処理部は、前記第2のCPUの第3のタスクに対して書き込み処理を実行し、同時に割り込み禁止処理部は、前記第1のタスクよりも優先度の低い第2のタスクにおいて、割り込み禁止処理を実行し、In step S3, the write processing unit executes a write process for the third task of the second CPU, and at the same time, the interrupt prohibition processing unit executes a second process having a lower priority than the first task. In the task, execute the interrupt disable process,
ステップS4において、前記排他処理部は、前記ステップS3における書き込み処理の終了に応じて、第1の排他処理を終了し、同時に前記割り込み禁止処理部は、前記第2のタスクにおける割り込み禁止処理を終了し、In step S4, the exclusion processing unit terminates the first exclusion processing in response to the completion of the writing processing in step S3, and at the same time, the interrupt inhibition processing unit terminates the interrupt inhibition processing in the second task. And
ステップS5において、待機処理部は、第1のタスクにおける読み込み処理の終了を待機する待機処理を実行し、In step S5, the standby processing unit executes a standby process for waiting for the end of the reading process in the first task,
ステップS6において、割り込み処理部は、前記第1のタスクに対して前記ステップS3の書き込み処理の終了後に、割り込み処理を実行し、In step S6, the interrupt processing unit executes interrupt processing for the first task after completion of the write processing in step S3,
ステップS7において、前記排他処理部は、前記ステップS6における割り込み処理に応じて、前記第1のタスクにおける読み込み処理部による読み込み処理の開始前に、前記第1の排他処理とは干渉しない第2の排他処理の実行を開始し、In step S7, in response to the interrupt processing in step S6, the exclusion processing unit does not interfere with the first exclusion processing before the reading processing by the reading processing unit in the first task is started. Start exclusive processing,
ステップS8において、前記読み込み処理部は、前記第3のタスクからの読み込み処理を実行し、In step S8, the read processing unit executes read processing from the third task,
ステップS9において、前記読み込み処理部は、前記第1のタスクにおける読み込み処理の終了を前記第2のタスクへ通知し、In step S9, the reading processing unit notifies the second task of the end of the reading process in the first task,
ステップS10において、前記排他処理部は、前記第1のタスクにおける第2の排他処理を終了し、In step S10, the exclusive processing unit ends the second exclusive processing in the first task,
ステップS11において、前記排他処理部は、前記第2のタスクにおける前記第1の排他処理を終了する電子機器の制御方法。In step S11, the exclusive processing unit controls the electronic device to end the first exclusive processing in the second task.
第2のCPUにおいて、第2のタスク実行部により第3のタスクが実行される電子機器の制御方法において、In the second CPU, in the control method of the electronic device in which the third task is executed by the second task execution unit,
ステップS1において、排他処理部は、第2のタスクにおける書き込み処理部による書き込み処理の開始前に、第1の排他処理の実行を開始し、In step S1, the exclusive processing unit starts executing the first exclusive process before the start of the write process by the write processing unit in the second task,
ステップS2において、前記書き込み処理部は、前記第2のタスクにおいて前記第2のCPUの前記第3のタスクに対して書き込み処理を実行し、同時に割り込み禁止処理部は、前記第1のタスクよりも優先度の低い前記第2のタスクにおいて割り込み禁止処理を実行し、In step S2, the write processing unit performs a write process on the third task of the second CPU in the second task, and at the same time, the interrupt prohibition processing unit is more than the first task. The interrupt prohibition process is executed in the second task having a low priority,
ステップS3において、前記排他処理部は、前記第4のタスクにおいて第1の排他処理を開始し、In step S3, the exclusive processing unit starts the first exclusive processing in the fourth task,
ステップS4において、前記排他処理部は、前記第4のタスクにおいて、前記第1の排他処理とは互いに干渉しない第2の排他処理を開始し、In step S4, the exclusion processing unit starts a second exclusion process that does not interfere with the first exclusion process in the fourth task,
ステップS5において、待機処理部は、前記第4のタスクにおいて待機処理を実行することにより、前記第2のタスクにおいて実行される前記第2の排他処理の終了を待機し、In step S5, the standby processing unit waits for the end of the second exclusive process executed in the second task by executing the standby process in the fourth task,
ステップS6において、前記排他処理部は、前記第2のタスクにおける前記第1の排他処理を終了し、待機処理部へ通知し、In step S6, the exclusive processing unit ends the first exclusive processing in the second task and notifies the standby processing unit,
ステップS7において、描画処理部は、前記第2のタスクにおける前記第1の排他処理の終了通知に応じて、LCD制御部の第5のタスクに対して描画処理を実行し、In step S7, the drawing processing unit executes a drawing process on the fifth task of the LCD control unit in response to the end notification of the first exclusive process in the second task,
ステップS8において、割り込み処理部は、前記第1のタスクに対して割り込み処理を実行し、In step S8, the interrupt processing unit executes interrupt processing for the first task,
ステップS9において、前記排他処理部は、前記第2の排他処理の実行を開始し、In step S9, the exclusive processing unit starts executing the second exclusive process,
ステップS10において、前記待機処理部は、第1のタスクにおいて待機処理を実行することにより、第4のタスクにおける第2の排他処理の終了を待機し、In step S10, the standby processing unit waits for the end of the second exclusive process in the fourth task by executing the standby process in the first task,
ステップS11において、描画受信処理部は、前記ステップS7における描画処理に応じて、前記第5のタスクからの描画処理が終了したことの通知を受信し、In step S11, the drawing reception processing unit receives a notification that the drawing process from the fifth task has ended in response to the drawing process in step S7,
ステップS12において、前記排他処理部は、前記第4のタスクにおける前記第2の排他処理を終了し、In step S12, the exclusive processing unit ends the second exclusive processing in the fourth task,
ステップS13において、前記排他処理部は、前記第4のタスクにおける前記第1の排他処理を終了し、In step S13, the exclusive processing unit ends the first exclusive processing in the fourth task,
ステップS14において、読み込み処理部は、前記第1のタスクにおける読み込み処理を実行することにより、前記第3のタスクからデータの読み込み処理を実行し、In step S14, the read processing unit executes the read process in the first task, thereby executing the data read process from the third task,
ステップS15において、前記排他処理部は、前記第1のタスクにおける前記第1の排他処理を終了する電子機器の制御方法。In step S15, the exclusive processing unit controls the electronic device to end the first exclusive processing in the first task.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008278700A JP5324188B2 (en) | 2008-10-29 | 2008-10-29 | Electronics |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008278700A JP5324188B2 (en) | 2008-10-29 | 2008-10-29 | Electronics |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010108179A JP2010108179A (en) | 2010-05-13 |
JP5324188B2 true JP5324188B2 (en) | 2013-10-23 |
Family
ID=42297581
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008278700A Expired - Fee Related JP5324188B2 (en) | 2008-10-29 | 2008-10-29 | Electronics |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5324188B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6962717B2 (en) * | 2017-06-15 | 2021-11-05 | 日本電気株式会社 | Information processing equipment, information processing methods and information processing programs |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3256387B2 (en) * | 1994-11-04 | 2002-02-12 | 株式会社日立製作所 | Exclusive control method, processor and computer system |
-
2008
- 2008-10-29 JP JP2008278700A patent/JP5324188B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2010108179A (en) | 2010-05-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP1453286B1 (en) | Mobile communication terminal, method for controlling execution state of application program, application program, and recording medium wherein application program has been recorded | |
KR20130008424A (en) | Apparatus and method for executing a shortcut function in a portable terminal | |
JP2008154004A (en) | Portable terminal and information communicating method | |
JP2001222363A (en) | Method for extending key function in mobile communication terminal | |
US9734829B2 (en) | Electronic device, control method, and control program | |
JP5097680B2 (en) | Portable electronic devices | |
JP5324188B2 (en) | Electronics | |
US8723802B2 (en) | Mobile electronic device | |
JP4988663B2 (en) | Portable electronic devices | |
JP5337441B2 (en) | Portable electronic devices | |
JP5537198B2 (en) | Portable electronic devices | |
JP5751881B2 (en) | Electronic device, application determination method, and application determination program | |
US9052822B2 (en) | Portable electronic device, and control method and control program for the same | |
US20150222411A1 (en) | Electronic device and method for providing communication service | |
JP5826999B2 (en) | Electronic device and control method | |
JP2005252386A (en) | Information terminal | |
JP5473657B2 (en) | Portable electronic device and display control method thereof | |
JP2011010060A (en) | Communication system | |
JP2010026909A (en) | Portable terminal device and program | |
JP5244544B2 (en) | Mobile device | |
JP5216464B2 (en) | Portable electronic devices | |
JP4986947B2 (en) | Portable electronic devices | |
JP5364690B2 (en) | Portable electronic devices | |
JP5398865B2 (en) | Portable electronic devices | |
AU2003213198B2 (en) | Method and apparatus for emulating a mobile device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110929 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20120803 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130215 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130226 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130425 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20130625 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130718 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5324188 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |