WO2012105000A1 - プログラム実行方法 - Google Patents

プログラム実行方法 Download PDF

Info

Publication number
WO2012105000A1
WO2012105000A1 PCT/JP2011/052064 JP2011052064W WO2012105000A1 WO 2012105000 A1 WO2012105000 A1 WO 2012105000A1 JP 2011052064 W JP2011052064 W JP 2011052064W WO 2012105000 A1 WO2012105000 A1 WO 2012105000A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
power consumption
code
application
execution
Prior art date
Application number
PCT/JP2011/052064
Other languages
English (en)
French (fr)
Inventor
康志 栗原
浩一郎 山下
鈴木 貴久
宏真 山内
Original Assignee
富士通株式会社
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 富士通株式会社 filed Critical 富士通株式会社
Priority to JP2012555619A priority Critical patent/JP5505522B2/ja
Priority to PCT/JP2011/052064 priority patent/WO2012105000A1/ja
Publication of WO2012105000A1 publication Critical patent/WO2012105000A1/ja
Priority to US13/956,710 priority patent/US9336052B2/en

Links

Images

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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • G06F9/4893Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues taking into account power or heat criteria
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • G06F8/4432Reducing the energy consumption
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/324Power saving characterised by the action undertaken by lowering clock frequency
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present invention relates to a program execution method for executing a program of a target application.
  • Java registered trademark
  • byte code Java virtual machine
  • Byte code is an execution code generated by a Java compiler. Byte code is a kind of intermediate code and does not depend on a specific execution environment. The byte code is executed after being converted into a native code by an interpreter in JavaVM (see, for example, Patent Document 1 below). For example, as JavaVM, a JIT (Just In Time) compiler (see, for example, Patent Documents 2 and 3 below) can be cited. Native code is a program written in machine language unique to the terminal.
  • an application is downloaded in byte code, and the application is executed with the byte code using JavaVM.
  • the CPU Central Processing Unit
  • idle time arises at the time of execution of an application, the technique of executing another application in this idle time according to the order of priority is known (for example, refer patent document 5 below).
  • An object of the present invention is to provide a program execution method for executing an application with a code in accordance with the performance of each terminal while suppressing power consumption in order to solve the above-described problems caused by the prior art.
  • a first power consumption during execution of a first program described by a first code is calculated, and the first program
  • the second power consumption at the time of execution of the second program having the same function as described above and described by the second code is calculated, and when the second power consumption is smaller than the first power consumption, the second power consumption is calculated.
  • a program execution method for converting one program into the second program and executing the second program is proposed.
  • FIG. 1 is an explanatory diagram showing an example of the present invention.
  • FIG. 2 is an explanatory diagram showing hardware of the multi-core processor system.
  • FIG. 3 is a functional block diagram of the multi-core processor system 200.
  • FIG. 4 is an explanatory diagram showing an example of the allocation management table.
  • FIG. 5 is an explanatory diagram illustrating an example of a power consumption table used in the first embodiment.
  • FIG. 6 is an explanatory diagram showing an example of the conversion management table.
  • FIG. 7 is an explanatory diagram showing download of application #A.
  • FIG. 8 is an explanatory diagram showing a registration example of the conversion management table 600.
  • FIG. 9 is an explanatory diagram illustrating a conversion example.
  • FIG. 1 is an explanatory diagram showing an example of the present invention.
  • FIG. 2 is an explanatory diagram showing hardware of the multi-core processor system.
  • FIG. 3 is a functional block diagram of the multi-core processor system 200.
  • FIG. 4 is an explanatory
  • FIG. 10 is an explanatory diagram showing an example of updating the assignment management table 400 by assigning the compiler 900 and the application #A.
  • FIG. 11 is an explanatory diagram showing an example of the end of compilation.
  • FIG. 12 is an explanatory diagram showing an example of updating the conversion management table 600 after the conversion is completed.
  • FIG. 13 is an explanatory diagram showing an example of updating the allocation management table 400 after the conversion is completed.
  • FIG. 14 is a flowchart illustrating an example of a conversion control processing procedure by each OS at the time of downloading.
  • FIG. 15 is a flowchart of an example of a conversion control processing procedure performed by the compile scheduler 700 according to the first embodiment.
  • FIG. 16 is a flowchart showing a program execution processing procedure by each OS.
  • FIG. 17 is an explanatory diagram of a determination example according to the second embodiment.
  • FIG. 18 is an explanatory diagram of an example of a power consumption table used in the second embodiment.
  • FIG. 19 is a flowchart of an example of a conversion control processing procedure performed by the compile scheduler 700 according to the second embodiment.
  • the first program described by the first code is referred to as a target application bytecode.
  • the second program having the same function as the first program and described by the second code is referred to as a native code of the target application.
  • FIG. 1 is an explanatory diagram showing an example of the present invention.
  • the program execution device performs conversion with byte code while converting from byte code to native code, and when the conversion is executed with native code or with byte code, the power consumption is either Determine if it will be lower.
  • the program execution device determines whether to convert from byte code to native code based on the determination result.
  • a graph 100 shows power consumption in the case of executing with byte code while converting from byte code to native code, and executing with native code after the conversion is completed.
  • a graph 101 shows the power consumption when executed in bytecode.
  • the program execution device downloads the target application.
  • the information regarding the target application includes a byte code, an execution time (T) in the byte code, and a code amount (Code) of the byte code.
  • the execution time (T) in the byte code of the target application is the execution performance required when executing with the byte code. In FIG. 1, it is determined whether or not the value of power consumption is small when execution is performed in native code with the same performance as that in byte code.
  • the program execution device calculates a conversion time (Tc) required for conversion from the byte code of the target application to the native code of the target application using the code amount. Tc is calculated based on the following formula (1).
  • k is a proportional coefficient determined by the performance of the CPU and the performance of the compiler.
  • C is a constant determined by CPU performance and compiler performance.
  • the program execution device determines to convert the byte code of the target application into native code.
  • the following formula (3) does not hold, it is determined that the byte code of the target application is not converted to native code.
  • Pc is a value of power consumption per unit time at the time of conversion from byte code to native code
  • Pn is a value of power consumption per unit time at the time of execution in native code
  • P is a byte code. This is the value of power consumption per unit time during execution.
  • Pn ⁇ P ⁇ Pc. Since JavaVM must be executed for execution by byte code, the value of power consumption per unit time is larger for execution by byte code than for execution by native code.
  • Pn, P, and Pc are determined in advance according to the performance of the CPU included in each terminal.
  • the CPU performance here refers to, for example, the calculation capability and the frequency of the clock supplied at each execution.
  • the expression (3) does not include P ⁇ Tc.
  • the power consumption is calculated based on the execution time of the target application. Since the execution time of a game such as a fortune-telling application that can be predicted for execution time or an advertisement on a banner is constant, the program execution device can download the execution time together with the bytecode as described above.
  • the application execution time may be embedded in an HTML (Hyper text markup language) by the application developer. Further, the program execution device may predict the execution time of the target application from the statistical data of the execution time of the target application.
  • the program execution device may be a single-core system or a multi-core processor system.
  • the multi-core processor system will be described as an example.
  • the multi-core processor is a processor in which a plurality of cores are mounted. If a plurality of cores are mounted, a single processor having a plurality of cores may be used, or a processor group in which single core processors are arranged in parallel may be used.
  • a processor group in which single-core processors are arranged in parallel will be described as an example.
  • FIG. 2 is an explanatory diagram showing hardware of the multi-core processor system.
  • the multi-core processor system 200 includes a CPU # 0, a CPU # 1, a display 201, a keyboard 202, an I / F (Interface) 203, and a RAM (Randam Access Memory) 206. Yes.
  • the multi-core processor system 200 includes a flash ROM (Read Only Memory) controller 204, a flash ROM 205, a ROM 207, a flash ROM 208, and a clock supply circuit 209.
  • CPU # 0, CPU # 1, display 201, keyboard 202, I / F 203, flash ROM controller 204, RAM 206, ROM 207, and flash ROM 208 are connected via a bus 212.
  • CPU # 0 and CPU # 1 each have a register and a core.
  • the core has a calculation function.
  • the registers in each CPU have a PC (Program Counter) and a reset register.
  • CPU # 0 is a master CPU that controls the entire multi-core processor system 200 and executes the OS 240.
  • the OS 240 is a master OS and executes an application assigned to the CPU # 0.
  • the OS 240 has a scheduler, and the scheduler has a function of controlling which CPU of the multi-core processor an application that has received a start instruction is assigned.
  • the scheduler has a function of controlling the execution order of applications assigned to CPU # 0.
  • CPU # 1 is a slave CPU and executes the OS 241.
  • the OS 241 is a slave OS and executes an application assigned to the CPU # 1.
  • the OS 241 has a scheduler, and the scheduler has a function of controlling the execution order of applications assigned to the CPU # 1.
  • the primary cache 230 and the primary cache 231 each have a cache memory and a cache controller.
  • the primary cache 230 temporarily stores a writing process from the thread of an application executed by the OS 240 to the RAM 206.
  • the primary cache 230 temporarily stores data read from the RAM 206.
  • the primary cache 231 temporarily stores write processing from the thread of the application executed by the OS 241 to the RAM 206.
  • the primary cache 231 temporarily stores data read from the RAM 206.
  • the snoop controller 210 detects the update and updates the data in the other primary caches. have.
  • the secondary cache 211 has a cache memory and a cache controller.
  • the secondary cache 211 stores data evicted from the primary cache 230 and the primary cache 231.
  • the secondary cache 211 stores data shared between the OS 240 and the OS 241.
  • the secondary cache 211 has a larger storage capacity and slower access speed from each CPU than the primary cache 230 and the primary cache 231.
  • the secondary cache 211 has a smaller storage capacity and higher access speed from each CPU than the RAM 206.
  • the display 201 displays data such as a document, an image, and function information, as well as a cursor, an icon, or a tool box.
  • data such as a document, an image, and function information, as well as a cursor, an icon, or a tool box.
  • a TFT liquid crystal display can be adopted as the display 201.
  • the keyboard 202 has keys for inputting numbers, various instructions, and the like, and inputs data.
  • the keyboard 202 may be a touch panel type input pad or a numeric keypad.
  • the I / F 203 is connected to a network such as a LAN (Local Area Network), a WAN (Wide Area Network), or the Internet through a communication line, and is connected to another device via the network.
  • the I / F 203 controls a network and an internal interface and controls data input / output from an external device.
  • a modem or a LAN adapter can be employed as the I / F 203.
  • an application is downloaded to the flash ROM 208 via the I / F 203.
  • Flash ROM controller 204, flash ROM 205, RAM 206, ROM 207, and flash ROM 208 are memories shared by CPU # 0 and CPU # 1. Although not shown, the memory controller arbitrates access requests from the CPUs to the memories.
  • the ROM 207 stores a program such as a boot program.
  • the RAM 206 is used as a work area for each CPU.
  • the flash ROM 208 stores system software such as the OS 240 and OS 241, the byte code of the application, and the native code of the application.
  • the flash ROM controller 204 controls reading / writing of data with respect to the flash ROM according to the control of each CPU.
  • the flash ROM 205 stores data written under the control of the flash ROM controller 204. Specific examples of the data include image data and video data acquired by the user using the multi-core processor system 200 through the I / F 203.
  • As the flash ROM 205 for example, a memory card, an SD card, or the like can be adopted.
  • the clock supply circuit 209 supplies a clock to each unit such as a CPU.
  • the clock frequencies that the clock supply circuit 209 can supply to the CPU are 100 [MHz], 200 [MHz], and 300 [MHz].
  • the clock supply circuit 209 includes a register 220 and a register 221.
  • the register 220 can set the frequency of the clock supplied to the CPU # 0, and the register 221 can set the frequency of the clock supplied to the CPU # 1.
  • the frequency of the clock supplied to the CPU # 0 is 100 [MHz]
  • the value of the register 220 is 2
  • the frequency of the clock supplied to the CPU # 0 is 200 [MHz].
  • the value of the register 220 is 3, the frequency of the clock given to the CPU # 0 is 300 [MHz].
  • the value of the register 221 is 1, the frequency of the clock supplied to the CPU # 1 is 100 [MHz].
  • the value of the register 221 is 2, the frequency of the clock supplied to the CPU # 1 is 200 [MHz]. .
  • the value of the register 221 is 3, the frequency of the clock given to the CPU # 1 is 300 [MHz].
  • FIG. 3 is a functional block diagram of the multi-core processor system 200.
  • the multi-core processor system 200 includes an acquisition unit 301, a conversion time calculation unit 302, a first calculation unit 303, a second calculation unit 304, a determination unit 305, a conversion unit 306, an execution unit 307, a control Part 308.
  • a program in which processing related to the acquisition unit 301 to the control unit 308 is coded is stored in a storage device such as the flash ROM 208.
  • the CPU of the multi-core processor accesses the storage device, reads the program, and executes the processing coded in the program, the processing relating to the acquisition unit 301 to the control unit 308 is executed.
  • the program is an OS 240, an OS 241, and a compile scheduler described later.
  • the acquisition unit 301 acquires the conversion time (Tc) required for conversion from the bytecode that is not the machine language of the target application to the native code that is the machine language, and the execution time (T) in the bytecode.
  • the conversion time (Tc) may be acquired or calculated.
  • the acquisition unit 301 acquires the code amount of the byte code.
  • the conversion time calculation unit 302 calculates the conversion time (Tc) according to the code amount of the byte code and the performance of the CPU. Specifically, for example, the conversion time calculation unit 302 calculates based on the above equation (2).
  • the first calculation unit 303 calculates the first power consumption during execution with bytecode. Specifically, for example, the first calculation unit 303 calculates the difference value (Tn) between the execution time (T) acquired by the acquisition unit 301 and the conversion time (Tc) calculated by the conversion time calculation unit 302. calculate. The first calculation unit 303 uses the difference value (Tn) and the power consumption value per unit time (P) during execution in bytecode to calculate the power consumption value (P ⁇ Tn) is calculated.
  • the power consumption value (P ⁇ Tn) during execution in bytecode is the first power consumption.
  • the second calculation unit 304 calculates the second power consumption during execution in the native code. Specifically, for example, the second calculation unit 304 calculates the conversion time (Tc) based on the conversion time (Tc) calculated by the conversion time calculation unit 302 and the power consumption value (Pc) per unit time at the time of conversion. ) To calculate the power consumption value (Pc ⁇ Tc).
  • the second calculation unit 304 uses the difference value (Tn) and the power consumption value per unit time (Pn) when executed in the native code (Pn). Pn ⁇ Tn) is calculated.
  • the second calculation unit 304 calculates the power consumption value during the conversion time calculated by the first calculation unit 303 and the power consumption value during execution in the native code calculated by the second calculation unit 304.
  • the added value is calculated.
  • the added value is the second power consumption.
  • the second calculation unit 304 is based on the ratio (Y) of the power consumption value (Pc) per unit time during conversion to the power consumption value (P) per unit time during execution in bytecode. Then, the second power consumption may be calculated. Further, the second calculation unit 304 is based on the ratio (X) of the power consumption value (Pn) per unit time during conversion to the power consumption value (P) per unit time during execution in bytecode. Then, the second power consumption may be calculated.
  • the determining unit 305 determines whether or not the added value calculated by the second calculating unit 304 is less than the power consumption value at the time of execution with the byte code calculated by the first calculating unit 303.
  • the conversion unit 306 converts the byte code into a native code when it is determined that the addition value is less than the power consumption value at the time of execution in the byte code calculated by the determination unit 305.
  • the conversion unit 306 does not convert the byte code into the native code when it is determined that the addition value is not less than the power consumption value at the time of execution in the byte code calculated by the determination unit 305.
  • the execution unit 307 determines that the addition value is less than the power consumption value at the time of execution in the byte code calculated by the determination unit 305, the conversion from the byte code to the native code by the conversion unit 306 ends. Until it is executed with byte code. When the conversion unit 306 finishes converting the byte code into the native code, the execution unit 307 executes the native code. When the determination unit 305 determines that the added value is not less than the power consumption value at the time of execution in the byte code, the execution unit 307 executes the byte code.
  • the control unit 308 sets the frequency of the operation clock set when the conversion unit 306 converts the byte code to the native code higher than the frequency of the operation clock set when executing with the byte code.
  • the control unit 308 sets the clock frequency set when executing with native code to be lower than the clock frequency set when executing with byte code.
  • Examples 1 and 2 Based on the above, a detailed description will be given using Examples 1 and 2.
  • P, Pc, and Pn In the first embodiment, an example of determining whether to convert from byte code to native code based on P, Pc, and Pn is shown.
  • Pn In the second embodiment, an example of determining whether to convert from byte code to native code based on X and Y will be described.
  • FIG. 4 is an explanatory diagram showing an example of the allocation management table.
  • the allocation management table 400 which application is assigned to each CPU is registered.
  • the allocation management table 400 includes a CPU identification information item 401 and an application identification information item 402.
  • CPU identification information is registered.
  • identification information indicating CPU # 0 and CPU # 1 is registered.
  • the allocation management table 400 is stored in a storage device such as the RAM 206, the primary cache 230, the primary cache 231, and the secondary cache 211.
  • FIG. 5 is an explanatory diagram showing an example of a power consumption table used in the first embodiment.
  • the power consumption table 500 includes an execution item 501, a clock frequency item 502, and a power consumption item 503 per unit time.
  • execution item 501 any of native code execution, byte code execution, and compiler execution is registered.
  • clock frequency item 502 the frequency of the clock supplied to the CPU in accordance with the execution registered in the execution item 501 is registered.
  • the power consumption per unit time item 503 the power consumption per unit time at the time of execution registered in the execution item 501 is registered.
  • Pc is 100 [mW]
  • Pn is 25 [mW]
  • P is 50 [mW] (Pn ⁇ P ⁇ Pc).
  • the frequency (Cc) of the clock given to the CPU when the compiler is executed is 300 [MHz]
  • the frequency (Cn) of the clock given to the CPU when executed by the native code is 100 [MHz].
  • the frequency (Cb) of the clock given to the CPU at the time of execution with bytecode is 200 [MHz].
  • Cn, Cb, and Cc The relationship between Cn, Cb, and Cc is Cn ⁇ Cb ⁇ Cc.
  • JavaVM executes while converting to native code, so execution with bytecode has a larger amount of processing than execution with native code. Therefore, even when the frequency of the clock is lower than when executing with the byte code when executing with the native code, the operation requested when executing with the byte code can be satisfied.
  • the power consumption table 500 is stored in a storage device such as the RAM 206, the primary cache 230, the primary cache 231, and the secondary cache 211.
  • FIG. 6 is an explanatory diagram showing an example of the conversion management table.
  • the conversion management table 600 the conversion state of an application determined to be converted from byte code to native code is managed.
  • the conversion management table 600 includes an application identification information item 601 and a conversion state item 602.
  • the application identification information item 601 identification information of an application determined to be converted from byte code to native code is registered.
  • the conversion management table 600 is stored in a storage device such as the RAM 206, the primary cache 230, the primary cache 231, and the secondary cache 211.
  • FIG. 7 is an explanatory diagram showing download of application #A.
  • the OS 240 downloads the application #A via the I / F 203.
  • the byte code of application #A, the execution time (T) in the byte code of application #A, and the code amount (Code) of the byte code of application #A are downloaded.
  • the OS 240 activates the compile scheduler 700.
  • the compile scheduler 700 has a function of converting the byte code of the application into a native code indicated in a machine language that can be interpreted by the CPU # 0 and CPU # 1.
  • the compile scheduler 700 acquires the execution time (T) of the downloaded application #A and the code amount (Code) of the application #A. For example, suppose T, Code, k, and C are as follows.
  • the compile scheduler 700 calculates the conversion time (Tc) from the byte code 701 of the application #A to the native code of the application #A based on the above formula (1), and the converted native based on the above formula (2)
  • the execution time (Tn) in the code is calculated.
  • the compile scheduler 700 acquires P, Pc, and Pn from the power consumption table 500, and determines Expression (3). As described above, Pc is 100 [mW], Pn is 25 [mW], and P is 50 [mW].
  • the compile scheduler 700 determines to convert the byte code 701 of the application #A into the native code of the application #A.
  • the compile scheduler 700 notifies the OS 240 of the determination result.
  • FIG. 8 is an explanatory diagram showing a registration example of the conversion management table 600.
  • the OS 240 receives the determination result, the identification information of the application #A is registered in the item 601 of the identification information of the application in the conversion management table 600, and incomplete is registered in the item 602 of the conversion state.
  • FIG. 9 is an explanatory diagram showing a conversion example.
  • the OS 240 assigns the compiler 900 to the CPU # 1.
  • the OS 241 executes the compiler 900, and the compiler 900 converts the byte code 701 of the application #A into the native code 901 of the application #A.
  • the OS 240 executes the application #A with the byte code 701 of the application #A on the Java VM 902.
  • FIG. 10 is an explanatory diagram showing an example of updating the assignment management table 400 by assigning the compiler 900 and the application #A.
  • the CPU identification information item 401 is CPU # 0.
  • the Java VM: application #A is registered in the application identification information item 402.
  • JavaVM: application #A indicates that application #A is being executed by JavaVM 902.
  • the compiler 900 is registered in the identification information item 402 of the application whose identification information item 401 of the CPU of the allocation management table 400 is CPU # 1.
  • FIG. 11 is an explanatory diagram showing an example of completion of compilation.
  • the conversion from the byte code 701 of the application #A to the native code 901 of the application #A ends.
  • the compiler 900 registers completion in the conversion status item 602 in which the application identification information item 601 in the conversion management table 600 is the application #A. Then, the compiler 900 ends.
  • FIG. 12 is an explanatory diagram showing an example of updating the conversion management table 600 after the conversion is completed.
  • completion is registered in the conversion status item 602 in which the application identification information item 601 is the application #A.
  • the OS 241 sets the value of the register 221 of the clock supply circuit 209 to 1. Thereby, the frequency of the clock given to CPU # 1 becomes 100 [MHz].
  • the OS 241 deletes the compiler 900 from the identification information item 402 of the application whose CPU 401 has the identification information item 401 of the CPU in the allocation management table 400.
  • the Java VM 902 When the OS 240 receives a conversion end notification from the byte code 701 of the application #A to the native code 901 of the application #A, the Java VM 902 is ended.
  • the OS 240 sets the value of the register 220 of the clock supply circuit 209 to 1. As a result, the frequency of the clock given to the CPU # 0 becomes 100 [MHz].
  • the OS 240 executes the application #A with the native code 901 of the application #A.
  • the OS 240 deletes JavaVM: application #A from the application identification information item 402 whose CPU identification information item 401 is CPU # 0 in the assignment management table 400, and registers the application #A.
  • FIG. 13 is an explanatory diagram showing an update example of the assignment management table 400 after the conversion is completed.
  • the compiler 900 is deleted from the identification information item 402 of the app whose CPU identification information item 401 is CPU # 1.
  • the application #A is registered in the identification information item 402 of the application whose CPU identification information item 401 is CPU # 0.
  • FIG. 14 is a flowchart illustrating an example of a conversion control processing procedure performed by each OS during download. Any OS may be used for downloading.
  • the compile scheduler 700 is activated (step S1402).
  • the OS determines whether the determination result is received from the compile scheduler 700 (step S1403).
  • step S1403: No the process returns to step S1403.
  • step S1403: Yes it is determined whether or not the determination result indicates that the downloaded application is to be converted (step S1404).
  • step S1404 When the OS indicates that the downloaded result is to be converted (step S1404: Yes), the compiler 900 is assigned to a CPU with a low load (step S1405), and the process proceeds to step S1406. In step S1404, when the OS indicates that the determination result does not convert the downloaded application (step S1404: No), the process proceeds to step S1406.
  • the OS executes the downloaded application on the Java VM by the CPU having a small load (step S1406), and the series of processes is terminated.
  • FIG. 15 is a flowchart of an example of a conversion control processing procedure performed by the compile scheduler 700 according to the first embodiment.
  • the compile scheduler 700 acquires P, Pc, and Pn (step S1504), and determines whether Pc ⁇ Tc + Pn ⁇ Tn ⁇ P ⁇ Tn is satisfied (step S1505).
  • step S1505 If the compile scheduler 700 determines that Pc ⁇ Tc + Pn ⁇ Tn ⁇ P ⁇ Tn is satisfied (step S1505: Yes), it is determined to convert to native code (step S1506). When the compile scheduler 700 determines that Pc ⁇ Tc + Pn ⁇ Tn ⁇ P ⁇ Tn is not satisfied (step S1505: No), it determines not to convert into native code (step S1507). The compile scheduler 700 notifies the OS of the determination result after step S1506 and step S1507 (step S1508), and the series of processing ends.
  • FIG. 16 is a flowchart showing a program execution processing procedure by each OS. It is determined whether or not the OS has detected a dispatch, a switch, or a process end (step S1601). When the OS determines that the dispatch or switch and the process end have not been detected (step S1601: No), the process returns to step S1601.
  • step S1601 dispatch or switch
  • step S1602 determines whether the dispatched or switched application is an application for converting to native code or the compiler 900 (step S1602).
  • step S1603 the clock frequency is set to Cb (step S1603).
  • step S1604 the OS executes the application with bytecode on the Java VM (step S1604), and the process returns to step S1601.
  • step S1602 determines whether or not the application has been converted to native code (step S1605).
  • step S1605: No determines whether or not the application has been converted to native code (step S1605).
  • step S1605: Yes determines that the code has been converted to the native code (step S1605: Yes)
  • the clock frequency is set to Cn (step S1606)
  • the application is executed with the native code (step S1607), and the process returns to step S1601. .
  • step S1602 compiler
  • the clock frequency is set to Cc (step S1608).
  • the OS executes the compiler 900 (step S1609) and returns to step S1601.
  • step S1601 process end
  • step S1610 it is determined whether the application for which the process end has been detected is the compiler 900 (step S1610). If the OS determines that the application whose processing end has been detected is the compiler 900 (step S1610: Yes), the conversion management table 600 is updated (step S1611), and whether or not the processing of all applications has ended. Judgment is made (step S1612).
  • step S1612: No When the OS determines that the processing of all the applications has not been completed (step S1612: No), the process returns to step S1601. When the OS determines that the processing of all applications has been completed (step S1612: Yes), the series of processing ends. If it is determined in step S1610 that the application whose processing has been completed is not the compiler 900 (step S1610: No), the process proceeds to step S1612.
  • FIG. 17 is an explanatory diagram of a determination example according to the second embodiment.
  • Pc is Y ⁇ P and Pn is X ⁇ P. That is, X is the ratio of the value of power consumption per unit time during execution in native code to the value of power consumption per unit time during execution in bytecode. Y is the ratio of the value of the power consumption per unit time when the compiler 900 is executed to the value of the power consumption per unit time when the bytecode is executed.
  • Graph 1700 shows the power consumption in the case of executing with byte code while converting from byte code to native code, and executing with native code after the conversion is completed.
  • a graph 1701 shows the power consumption when executed in bytecode. About FIG. 17, it can represent like the following formula
  • Tc and Tn are calculated by the above formulas (1) and (2), respectively.
  • the equation (4) is shared by P, the following equation (5) is obtained.
  • the compile scheduler 700 determines to convert from bytecode to native code if equation (5) holds. If the expression (5) does not hold, the compile scheduler 700 determines not to convert from byte code to native code.
  • the application #A when the application #A is downloaded in the same manner as the first embodiment, the application #A can be changed depending on whether the above-described expression (4) or (5) is satisfied instead of the expression (3). It is determined whether or not to convert the byte code 701 into the native code 901 of the application #A.
  • the processing of the OS 240 and OS 241 is the same as the processing shown in the first embodiment, and therefore only the processing of the compile scheduler 700 will be described in detail.
  • X and Y are stored in advance in the power consumption table.
  • FIG. 18 is an explanatory diagram illustrating an example of a power consumption table used in the second embodiment.
  • the power consumption table 1800 includes an execution item 1801, a clock frequency item 1802, and a ratio item 1803.
  • execution item 1801 execution by native code, execution by byte code, and execution by a compiler are registered.
  • the clock frequency item 1802 the frequency of the clock supplied to the CPU at the time of execution registered in the execution item 1801 is registered.
  • the clock frequency (Cc) given to the CPU when the compiler 900 is executed is 300 [MHz]
  • the clock frequency (Cn) given to the CPU when executed in the native code is 100 [MHz].
  • the frequency (Cb) of the clock given to the CPU at the time of execution with byte code is 200 [MHz].
  • the ratio item 1803 the ratio between the power consumption per unit time during execution in bytecode and the power consumption per unit time during execution registered in the execution item 1801 is registered. Since Pc (Y ⁇ P) is 100 [mW], Pn (X ⁇ P) is 25 [mW], and P is 50 [mW], in the power consumption table 1800, X (0 ⁇ X ⁇ 1) is 1/2 and Y (1> Y) is 2. It is assumed that the power consumption table 1800 is stored in a storage device such as the RAM 206, the primary cache 230, the primary cache 231, and the secondary cache 211.
  • the compile scheduler 700 acquires X and Y from the power consumption table 1800, and determines Expression (5).
  • compile scheduler 700 decides to convert byte code 701 of application #A to native code 901 of application #A. To do.
  • the compile scheduler 700 notifies the OS of the determination result. Since the processing after the OS receives the determination result is the same as that in the first embodiment, detailed description thereof is omitted.
  • FIG. 19 is a flowchart of an example of a conversion control processing procedure performed by the compile scheduler 700 according to the second embodiment.
  • the compilation scheduler 700 acquires X and Y (step S1904), and determines whether (1 + Y) Tc + X ⁇ Tn ⁇ T is satisfied (step S1905).
  • step S1905: Yes If the compile scheduler 700 determines that (1 + Y) Tc + X ⁇ Tn ⁇ T (step S1905: Yes), it determines to convert to native code (step S1906). When the compile scheduler 700 determines that (1 + Y) Tc + X ⁇ Tn ⁇ T is not satisfied (step S1905: No), it determines not to convert into native code (step S1907). The compile scheduler 700 notifies the OS of the determination result after step S1906 and step S1907 (step S1908), and the series of processing ends.
  • whether to execute the target application by converting the byte code of the target application to native code is determined based on the power consumption value at the time of execution of each code To do. Thereby, power consumption can be suppressed, and when the target application is executed after being converted into a native code, the application can be executed with a code in accordance with the performance of each terminal.
  • the target application bytecode is not converted to native code, and the target application is converted into bytecode. Execute. Thereby, power consumption can be suppressed.
  • the power consumption value at the time of execution in the native code is calculated based on the execution time of the target application, the conversion time from the byte code to the native code, and the CPU performance. This indicates that the power consumption value at the time of execution in the native code varies depending on the power consumption value of the unit time value which varies depending on the performance of each CPU, and the application is executed with the code according to the performance of each terminal. be able to.
  • the conversion time is calculated based on the byte code amount. As a result, when the amount of code increases, the conversion time by the compiler becomes longer, so that it is possible to represent that the value of power consumption increases during execution with native code. Therefore, it is possible to improve the accuracy of the power consumption value during execution with the native code calculated before execution.
  • the conversion time is calculated based on CPU characteristics. Depending on the characteristics of the CPU, conversion by the compiler takes time and the conversion time becomes long. That is, the conversion time varies depending on the terminal, and the accuracy of the power consumption value can be improved during execution with the native code calculated before the execution. Furthermore, since the conversion time varies depending on the terminal, whether or not to convert depends on the performance of the terminal, and the application can be executed with a code according to the performance of each terminal.
  • the frequency of the clock given to the CPU at the time of conversion from the bytecode to the native code is made higher than the frequency of the clock given to the CPU at the time of execution with the bytecode. If conversion and bytecode execution are performed at the same time, the power consumption increases. However, since the clock frequency at the time of conversion increases, the conversion time can be shortened and the power consumption can be reduced.
  • the frequency of the clock given to the CPU when executed in native code is made lower than the frequency of the clock given to the CPU when executed in bytecode. Since the execution amount in the native code has a smaller processing amount than the execution in the byte code, even if the clock frequency is low in the execution in the native code, the operation requested in the execution in the byte code can be satisfied. Therefore, power consumption can be suppressed by lowering the clock frequency during execution in native code.
  • the application is executed with byte code during conversion from byte code to native code.
  • the user's responsiveness can be improved when the application is executed immediately after downloading.
  • the program execution method can be realized by executing a prepared program on any one of the multi-core processors.
  • the program is included in the OS 240, the OS 241, and the compile scheduler 700.
  • the program may be recorded on a recording medium readable by any CPU of the multi-core processor such as the flash ROM 205, and may be executed by being read from the recording medium by any CPU of the multi-core processor.
  • the program may be distributed through a network such as the Internet.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

 グラフ(100)では、バイトコードからネイティブコードに変換しつつバイトコードで実行し、変換終了後にネイティブコードで実行する場合の消費電力を示している。グラフ(101)では、バイトコードで実行する場合の消費電力を示している。グラフ(100)とグラフ(101)との共通部分を除くと、グラフ(100)で示す消費電力はPc×Tc+Pn×Tnである。グラフ(101)で示す消費電力はP×Tnである。Pc×Tc+Pn×TnがP×Tn未満であれば、プログラム実行装置が、対象アプリケーションのバイトコードをネイティブコードに変換すると決定する。Pc×Tc+Pn×TnがP×Tn未満でなければ、プログラム実行装置が、対象アプリケーションのバイトコードをネイティブコードに変換しないと決定する。

Description

プログラム実行方法
 本発明は、対象アプリケーションのプログラムを実行するプログラム実行方法に関する。
 従来、グリッドコンピュータなどを用いて分散処理を行う場合、個々のマシンの構成が異なるため、各マシンにはアプリケーションのJava(登録商標)バイトコード(以下、「バイトコード」と称する。)を配布する。そして、各マシンではJava仮想マシン(以下、「JavaVM(Virtual Machine)」と称する。)を用いてバイトコードで実行する。
 バイトコードはJavaのコンパイラが生成する実行用コードである。バイトコードは中間コードの一種で、特定の実行環境に依存しない。バイトコードはJavaVM内のインタプリタによってネイティブコードに変換されてから実行される(たとえば、下記特許文献1を参照。)。たとえば、JavaVMとしては、JIT(Just In Time)コンパイラ(たとえば、下記特許文献2,3を参照。)が挙げられる。ネイティブコードとは、端末固有の機械語で記述されたプログラムである。
 また、従来、携帯端末においては、アプリケーションはバイトコードでダウンロードされ、JavaVMを用いて該バイトコードでアプリケーションが実行されている。
 また、設計者がJavaで記述したソースコードと中間語にコンパイルされたバイトコードとの実行比率を電力要求に応じて決定することで、消費電力を削減する技術が知られている(たとえば、下記特許文献4を参照。)。
 また、CPU(Central Processing Unit)は複数のアプリケーションが割り当てられた場合、各アプリケーションの実行時間に基づいて実行の優先度を決定する。そして、CPUは、アプリケーションの実行時に空き時間が生じる場合、優先度の順に応じて該空き時間に他のアプリケーションを実行する技術が知られている(たとえば、下記特許文献5を参照。)。
特開2004-355277号公報 特開2001-195264号公報 特許第3808755号公報 特開2006-126947号公報 特開2009-151375号公報
 しかしながら、携帯端末のように端末によって性能が異なる場合、従来技術を用いれば消費電力を削減することはできても、電力要求がいずれの端末であっても同条件であれば、個々の端末の性能を引き出せない場合があるという問題点があった。
 本発明は、上述した従来技術による問題点を解消するため、消費電力を抑制しつつ、各端末の性能に沿ったコードでアプリケーションを実行するプログラム実行方法を提供することを目的とする。
 上述した課題を解決し、目的を達成するため、本発明の一観点によれば、第1のコードによって記述される第1プログラムの実行時の第1の消費電力を算出し、前記第1プログラムと同じ機能を有するとともに第2のコードによって記述される第2プログラムの実行時の第2の消費電力を算出し、前記第2の消費電力が前記第1の消費電力よりも小さいとき、前記第1プログラムを前記第2プログラムに変換して前記第2プログラムを実行するプログラム実行方法が提案される。
 本発明の一観点によれば消費電力を抑制しつつ、各端末の性能に沿ったコードでアプリケーションを実行するという効果を奏する。
図1は、本発明の一例を示す説明図である。 図2は、マルチコアプロセッサシステムのハードウェアを示す説明図である。 図3は、マルチコアプロセッサシステム200の機能ブロック図である。 図4は、割り当て管理テーブルの一例を示す説明図である。 図5は、実施例1で用いる消費電力テーブルの一例を示す説明図である。 図6は、変換管理テーブルの一例を示す説明図である。 図7は、アプリ#Aのダウンロードを示す説明図である。 図8は、変換管理テーブル600の登録例を示す説明図である。 図9は、変換例を示す説明図である。 図10は、コンパイラ900とアプリ#Aの割り当てによる割り当て管理テーブル400の更新例を示す説明図である。 図11は、コンパイル終了例を示す説明図である。 図12は、変換終了後の変換管理テーブル600の更新例を示す説明図である。 図13は、変換終了後の割り当て管理テーブル400の更新例を示す説明図である。 図14は、ダウロード時の各OSによる変換制御処理手順の一例を示すフローチャートである。 図15は、実施例1にかかるコンパイルスケジューラ700による変換制御処理手順の一例を示すフローチャートである。 図16は、各OSによるプログラム実行処理手順を示すフローチャートである。 図17は、実施例2にかかる判断例を示す説明図である。 図18は、実施例2で用いる消費電力テーブルの一例を示す説明図である。 図19は、実施例2にかかるコンパイルスケジューラ700による変換制御処理手順の一例を示すフローチャートである。
 以下に添付図面を参照して、本発明にかかるプログラム実行方法の実施の形態を詳細に説明する。本実施の形態では、第1のコードによって記述される第1のプログラムを対象アプリケーションのバイトコードと称する。第1のプログラムと同じ機能を有するとともに第2のコードによって記述される第2のプログラムを対象アプリケーションのネイティブコードと称する。
 図1は、本発明の一例を示す説明図である。ここでは、プログラム実行装置が、バイトコードからネイティブコードに変換しつつバイトコードで実行し、変換終了後にネイティブコードで実行する場合と、バイトコードで実行する場合と、のいずれの場合で消費電力が低くなるかを判断する。プログラム実行装置が、判断結果に基づいてバイトコードからネイティブコードに変換するか否かを決定する。グラフ100では、バイトコードからネイティブコードに変換しつつバイトコードで実行し、変換終了後にネイティブコードで実行する場合の消費電力を示している。グラフ101では、バイトコードで実行する場合の消費電力を示している。
 プログラム実行装置が、対象アプリケーションをダウンロードする。該対象アプリケーションに関する情報は、バイトコードと、バイトコードでの実行時間(T)と、バイトコードのコード量(Code)である。対象アプリケーションのバイトコードでの実行時間(T)は、バイトコードでの実行時に要求される実行性能である。図1では、バイトコードでの実行性能と同一性能でネイティブコードでの実行を行った場合に、消費電力の値が小さくなるか否かを判断している。プログラム実行装置が、コード量を用いて、対象アプリケーションのバイトコードから対象アプリケーションのネイティブコードへの変換にかかる変換時間(Tc)を算出する。Tcは下記式(1)に基づいて算出される。
 Tc≒k×Code+C ・・・(1)
 ここで、kはCPUの性能とコンパイラの性能によって決まる比例係数である。CはCPUの性能とコンパイラの性能によって決まる定数である。つぎに、プログラム実行装置が、ネイティブコードからバイトコードへの変換後に、対象アプリケーションをバイトコードで実行する実行時間(Tn)を下記式(2)に基づいて算出する。
 Tn=T-Tc ・・・(2)
 つぎに、プログラム実行装置が、下記式(3)が成り立つ場合、対象アプリケーションのバイトコードをネイティブコードに変換すると決定する。下記式(3)が成り立たない場合、対象アプリケーションのバイトコードをネイティブコードに変換しないと決定する。
 Pc×Tc+Pn×Tn<P×Tn ・・・(3)
 ここで、Pcはバイトコードからネイティブコードへの変換時の単位時間当たりの消費電力の値であり、Pnがネイティブコードでの実行時の単位時間当たりの消費電力の値であり、Pがバイトコードでの実行時の単位時間当たりの消費電力の値である。Pn<P<Pcである。バイトコードでの実行にはJavaVMを実行させなければならないため、バイトコードでの実行はネイティブコードでの実行よりも単位時間当たりの消費電力の値が大きくなる。
 また、Pn、P、Pcは、各端末が有するCPUの性能に沿ってあらかじめ決定されている。ここでのCPUの性能とは、具体的には、たとえば、計算能力や各実行時に供給されるクロックの周波数などである。グラフ100とグラフ101において、P×Tc(斜線部)は共通であるため、式(3)にはP×Tcが含まれていない。
 また、本実施の形態では、対象アプリケーションの実行時間に基づいて消費電力を算出している。占いアプリケーションなどの実行時間が予測可能なゲームやバナー上の広告などは実行時間が一定であるため、プログラム実行装置が、上述のようにバイトコードと併せて実行時間をダウンロードすることができる。アプリケーションの実行時間がアプリケーションの開発者によってHtml(Hyper text markup language)に埋め込まれていてもよい。また、プログラム実行装置が、対象アプリケーションの実行時間の統計データから対象アプリケーションの実行時間を予測してもよい。
 本プログラム実行装置は、シングルコアシステムであってもマルチコアプロセッサシステムであってもよいが、本実施の形態ではマルチコアプロセッサシステムを例に挙げて説明する。ここで、マルチコアプロセッサシステムにおいて、マルチコアプロセッサとは、コアが複数搭載されたプロセッサである。コアが複数搭載されていれば、複数のコアが搭載された単一のプロセッサでもよく、シングルコアのプロセッサが並列されているプロセッサ群でもよい。なお、本実施の形態では、説明を単純化するため、シングルコアのプロセッサが並列されているプロセッサ群を例に挙げて説明する。
(マルチコアプロセッサシステムのハードウェア)
 図2は、マルチコアプロセッサシステムのハードウェアを示す説明図である。図2において、マルチコアプロセッサシステム200は、CPU#0と、CPU#1と、ディスプレイ201と、キーボード202と、I/F(InterFace)203と、RAM(Randam Access Memory)206と、を有している。さらに、マルチコアプロセッサシステム200は、フラッシュROM(Read Only Memory)コントローラ204と、フラッシュROM205と、ROM207と、フラッシュROM208と、クロック供給回路209と、を有している。CPU#0と、CPU#1と、ディスプレイ201と、キーボード202と、I/F203と、フラッシュROMコントローラ204と、RAM206と、ROM207と、フラッシュROM208とは、バス212を介して接続されている。
 ここで、CPU#0とCPU#1は、それぞれレジスタとコアを有している。コアは、演算機能を有している。各CPU内のレジスタは、PC(Program Counter)やリセットレジスタを有している。
 CPU#0はマスタCPUであり、マルチコアプロセッサシステム200の全体の制御を司り、OS240を実行する。OS240はマスタOSであり、CPU#0に割り当てられたアプリケーションを実行する。OS240はスケジューラを有し、スケジューラは起動指示を受け付けたアプリケーションをマルチコアプロセッサのうちのいずれのCPUに割り当てるかを制御する機能を有している。スケジューラはCPU#0に割り当てられたアプリケーションの実行順序を制御する機能を有する。
 CPU#1は、スレーブCPUであり、OS241を実行する。OS241は、スレーブOSであり、CPU#1に割り当てられたアプリケーションを実行する。OS241は、スケジューラを有し、スケジューラはCPU#1に割り当てられたアプリケーションの実行順序を制御する機能を有する。
 1次キャッシュ230と1次キャッシュ231とは、それぞれキャッシュメモリとキャッシュコントローラとを有している。1次キャッシュ230はOS240が実行するアプリケーションのスレッドからRAM206への書込処理を一時的に記憶する。1次キャッシュ230は、RAM206から読み出されたデータを一時的に記憶する。1次キャッシュ231はOS241が実行するアプリケーションのスレッドからRAM206への書込処理を一時的に記憶する。1次キャッシュ231は、RAM206から読み出されたデータを一時的に記憶する。
 1次キャッシュ230と1次キャッシュ231とが共有するデータがいずれか一方のキャッシュで更新された場合、スヌープコントローラ210は、該更新を検出し、他の1次キャッシュ内の該データも更新する機能を有している。
 2次キャッシュ211は、キャッシュメモリとキャッシュコントローラとを有している。2次キャッシュ211では、1次キャッシュ230や1次キャッシュ231から追い出されたデータを記憶する。2次キャッシュ211では、OS240とOS241とが共有するデータを記憶する。2次キャッシュ211は、1次キャッシュ230や1次キャッシュ231よりも、記憶容量が大きくかつ各CPUからのアクセス速度が遅い。2次キャッシュ211はRAM206よりも、記憶容量が小さくかつ各CPUからのアクセス速度が速い。
 ディスプレイ201は、カーソル、アイコンあるいはツールボックスをはじめ、文書、画像、機能情報などのデータを表示する。ディスプレイ201は、たとえば、TFT液晶ディスプレイなどを採用することができる。キーボード202は、数字、各種指示などの入力のためのキーを有し、データの入力を行う。また、キーボード202は、タッチパネル式の入力パッドやテンキーなどであってもよい。
 I/F203は、通信回線を通じてLAN(Local Area Network)、WAN(Wide Area Network)、インターネットなどのネットワークに接続され、ネットワークを介して他の装置に接続される。そして、I/F203は、ネットワークと内部のインターフェースを司り、外部装置からのデータの入出力を制御する。I/F203には、たとえばモデムやLANアダプタなどを採用することができる。本実施の形態では、I/F203を介してフラッシュROM208へアプリケーションをダウンロードしている。
 フラッシュROMコントローラ204と、フラッシュROM205と、RAM206と、ROM207と、フラッシュROM208とは、CPU#0とCPU#1に共有されるメモリである。図示していないが、メモリコントローラが、各CPUから各メモリへのアクセス要求を調停する。
 ROM207は、ブートプログラムなどのプログラムを記憶している。RAM206は、各CPUのワークエリアとして使用される。フラッシュROM208は、OS240やOS241などのシステムソフトウェアやアプリケーションのバイトコードやアプリケーションのネイティブコードを記憶している。
 フラッシュROMコントローラ204は、各CPUの制御に従ってフラッシュROMに対するデータのリード/ライトを制御する。フラッシュROM205は、フラッシュROMコントローラ204の制御で書き込まれたデータを記憶する。データの具体例としては、マルチコアプロセッサシステム200を使用するユーザがI/F203を通して取得した画像データ、映像データなどである。フラッシュROM205は、たとえば、メモリカード、SDカードなどを採用することができる。
 クロック供給回路209は、CPUなど各部へクロックを供給する。ここでは、クロック供給回路209がCPUへ供給可能なクロックの周波数は100[MHz]と200[MHz]と300[MHz]とする。クロック供給回路209は、レジスタ220とレジスタ221を有する。レジスタ220はCPU#0へ与えるクロックの周波数を設定可能であり、レジスタ221はCPU#1へ与えるクロックの周波数を設定可能である。
 レジスタ220の値が1であれば、CPU#0へ与えるクロックの周波数が100[MHz]となり、レジスタ220の値が2であれば、CPU#0へ与えるクロックの周波数が200[MHz]となる。レジスタ220の値が3であれば、CPU#0へ与えるクロックの周波数が300[MHz]となる。レジスタ221の値が1であれば、CPU#1へ与えるクロックの周波数が100[MHz]となり、レジスタ221の値が2であれば、CPU#1へ与えるクロックの周波数が200[MHz]となる。レジスタ221の値が3であれば、CPU#1へ与えるクロックの周波数が300[MHz]となる。
(マルチコアプロセッサシステム200の機能ブロック図)
 図3は、マルチコアプロセッサシステム200の機能ブロック図である。マルチコアプロセッサシステム200は、取得部301と、変換時間算出部302と、第1の算出部303と、第2の算出部304と、判断部305と、変換部306と、実行部307と、制御部308と、を有している。具体的には、たとえば、フラッシュROM208などの記憶装置に取得部301~制御部308に関する処理がコーディングされたプログラムが記憶されている。マルチコアプロセッサのうちのCPUが該記憶装置にアクセスして該プログラムを読み出し、該プログラム内にコーディングされている処理を実行することにより、取得部301~制御部308に関する処理が実行される。本実施の形態では、該プログラムはOS240とOS241と後述するコンパイルスケジューラである。
 取得部301は、対象アプリケーションの機械語でないバイトコードから機械語であるネイティブコードへの変換にかかる変換時間(Tc)と、バイトコードでの実行時間(T)を取得する。変換時間(Tc)については、取得してもよいし算出してもよい。変換時間(Tc)を算出する場合には、取得部301は、バイトコードのコード量を取得する。変換時間算出部302は、変換時間(Tc)をバイトコードのコード量とCPUの性能とに応じて算出する。具体的には、たとえば、変換時間算出部302は、上記式(2)に基づいて算出する。
 第1の算出部303は、バイトコードでの実行時の第1の消費電力を算出する。具体的には、たとえば、第1の算出部303は、取得部301により取得された実行時間(T)と変換時間算出部302により算出された変換時間(Tc)との差分値(Tn)を算出する。第1の算出部303は、差分値(Tn)と、バイトコードでの実行時の単位時間当たりの消費電力の値(P)とにより、バイトコードでの実行時の消費電力の値(P×Tn)を算出する。ここでは、バイトコードでの実行時の消費電力の値(P×Tn)が第1の消費電力である。
 第2の算出部304は、ネイティブコードでの実行時の第2の消費電力を算出する。具体的には、たとえば、第2の算出部304は、変換時間算出部302により算出された変換時間(Tc)と変換時の単位時間当たりの消費電力の値(Pc)とにより変換時間(Tc)での消費電力の値(Pc×Tc)を算出する。
 そして、第2の算出部304は、差分値(Tn)と、ネイティブコードでの実行時の単位時間当たりの消費電力の値(Pn)とにより、ネイティブコードでの実行時の消費電力の値(Pn×Tn)を算出する。第2の算出部304は、第1の算出部303により算出された変換時間での消費電力の値と第2の算出部304により算出されたネイティブコードでの実行時の消費電力の値との加算値を算出する。ここでは、加算値が、第2の消費電力である。
 また、第2の算出部304では、バイトコードでの実行時の単位時間当たりの消費電力の値(P)に対する変換時の単位時間当たりの消費電力の値(Pc)の比率(Y)に基づいて第2の消費電力を算出してもよい。さらに、第2の算出部304では、バイトコードでの実行時の単位時間当たりの消費電力の値(P)に対する変換時の単位時間当たりの消費電力の値(Pn)の比率(X)に基づいて第2の消費電力を算出してもよい。
 判断部305は、第2の算出部304により算出された加算値が、第1の算出部303により算出されたバイトコードでの実行時の消費電力の値未満となるか否かを判断する。
 変換部306は、判断部305によって加算値が算出されたバイトコードでの実行時の消費電力の値未満であると判断された場合、バイトコードをネイティブコードへ変換する。変換部306は、判断部305によって加算値が算出されたバイトコードでの実行時の消費電力の値未満でないと判断された場合、バイトコードをネイティブコードへ変換しない。
 実行部307は、判断部305によって加算値が算出されたバイトコードでの実行時の消費電力の値未満であると判断された場合、変換部306によるバイトコードからネイティブコードへの変換が終了するまで、バイトコードで実行する。そして、実行部307は、変換部306によりバイトコードからネイティブコードへの変換が終了すると、ネイティブコードで実行する。実行部307は、判断部305によって加算値が算出されたバイトコードでの実行時の消費電力の値未満でないと判断された場合、バイトコードで実行する。
 制御部308は、変換部306によりバイトコードをネイティブコードに変換するときに設定される動作クロックの周波数を、バイトコードでの実行時に設定される動作クロックの周波数よりも高く設定する。制御部308は、ネイティブコードで実行するときに設定されるクロックの周波数をバイトコードで実行するときに設定されるクロックの周波数よりも低く設定する。
 以上を踏まえて、実施例1,2を用いて詳細に説明する。実施例1では、PとPcとPnとを基づいてバイトコードからネイティブコードへ変換するか否かを決定する例を示す。実施例2では、XとYとに基づいてバイトコードからネイティブコードへ変換するか否かを決定する例を示す。
(実施例1)
 図4は、割り当て管理テーブルの一例を示す説明図である。割り当て管理テーブル400には、各CPUにいずれのアプリが割り当てられているかが登録される。割り当て管理テーブル400は、CPUの識別情報の項目401と、アプリの識別情報の項目402と、を有している。CPUの識別情報の項目401には、CPUの識別情報が登録される。ここでは、CPU#0とCPU#1を示す識別情報が登録されている。
 アプリの識別情報の項目402には、CPUの識別情報の項目401に識別情報が登録された各CPUに割り当てられたアプリケーションの識別情報が登録される。割り当て管理テーブル400は、RAM206、1次キャッシュ230および1次キャッシュ231、2次キャッシュ211などの記憶装置に記憶されていることとする。
 図5は、実施例1で用いる消費電力テーブル一例を示す説明図である。消費電力テーブル500は、実行の項目501と、クロック周波数の項目502と、単位時間当たりの消費電力の項目503と、を有している。実行の項目501には、ネイティブコードでの実行と、バイトコードでの実行と、コンパイラの実行と、のいずれかが登録されている。クロック周波数の項目502には、実行の項目501に登録された実行に沿ったCPUへ供給するクロックの周波数が登録されている。単位時間当たりの消費電力の項目503には、実行の項目501に登録された実行時における単位時間当たりの消費電力が登録されている。
 消費電力テーブル500では、Pcが100[mW]であり、Pnが25[mW]であり、Pが50[mW]である(Pn<P<Pc)。消費電力テーブル500では、コンパイラを実行時にCPUへ与えるクロックの周波数(Cc)が300[MHz]であり、ネイティブコードでの実行時にCPUへ与えるクロックの周波数(Cn)は100[MHz]である。消費電力テーブル500では、バイトコードでの実行時にCPUへ与えるクロックの周波数(Cb)は200[MHz]である。
 CnとCbとCcとの関係は、Cn<Cb<Ccである。バイトコードではJavaVMがネイティブコードに変換しながら実行するため、バイトコードでの実行はネイティブコードでの実行と比較して処理量が多い。そのため、ネイティブコードでの実行時にバイトコードでの実行時よりもクロックの周波数が低くなっても、バイトコードでの実行時に要求された動作を満たすことができる。消費電力テーブル500は、RAM206、1次キャッシュ230および1次キャッシュ231、2次キャッシュ211などの記憶装置に記憶されていることとする。
 図6は、変換管理テーブルの一例を示す説明図である。変換管理テーブル600では、バイトコードからネイティブコードに変換すると決定されたアプリケーションの変換状態が管理される。変換管理テーブル600は、アプリの識別情報の項目601と変換状態の項目602を有している。アプリの識別情報の項目601には、バイトコードからネイティブコードに変換すると決定されたアプリケーションの識別情報が登録される。
 変換状態の項目602は、アプリの識別情報の項目601に識別情報が登録されたアプリケーションのバイトコードがネイティブコードへ変換されたか否かが登録される。変換が終了したアプリケーションに関する変換状態の項目602には、「完了」が登録され、変換が終了していないアプリケーションに関する変換状態の項目602には、「未完了」が登録される。変換管理テーブル600は、RAM206、1次キャッシュ230および1次キャッシュ231、2次キャッシュ211などの記憶装置に記憶されていることとする。
 図7は、アプリ#Aのダウンロードを示す説明図である。OS240が、アプリ#AをI/F203を介してダウンロードする。ここでは、アプリ#Aのバイトコードと、アプリ#Aのバイトコードでの実行時間(T)と、アプリ#Aのバイトコードのコード量(Code)とが、ダウンロードされる。そして、OS240が、コンパイルスケジューラ700を起動する。コンパイルスケジューラ700は、アプリケーションのバイトコードからCPU#0やCPU#1が解釈可能な機械語で示されたネイティブコードへ変換する機能を有する。コンパイルスケジューラ700が、ダウンロードされたアプリ#Aの実行時間(T)とアプリ#Aのコード量(Code)を取得する。たとえば、TとCodeとkとCとが下記であるとする。
 ・T=500[ms]
 ・Code=160バイト
 ・k=0.5
 ・C=10
 コンパイルスケジューラ700が、上記式(1)に基づいてアプリ#Aのバイトコード701からアプリ#Aのネイティブコードへの変換時間(Tc)を算出し、上記式(2)に基づいて変換後のネイティブコードでの実行時間(Tn)を算出する。
 ・Tc=0.5×160+10=90[ms]
 ・Tn=500[ms]-90[ms]=410[ms]
 コンパイルスケジューラ700が、消費電力テーブル500からPとPcとPnとを取得し、式(3)を判断する。上述のようにPcが100[mW]であり、Pnが25[mW]であり、Pが50[mW]である。
 ・式(3)の左辺=100[mW]×90[ms]+25[mW]×410[ms]
 =19250
 ・式(3)の右辺=50[mW]×410[ms]
 =20500
 式(3)の左辺が式(3)の右辺よりも小さいので、式(3)が成り立つ。よって、コンパイルスケジューラ700が、アプリ#Aのバイトコード701をアプリ#Aのネイティブコードに変換すると決定する。コンパイルスケジューラ700が、決定結果をOS240へ通知する。
 図8は、変換管理テーブル600の登録例を示す説明図である。OS240が、決定結果を受け付けると、変換管理テーブル600のアプリの識別情報の項目601にアプリ#Aの識別情報を登録し、変換状態の項目602に未完了を登録する。
 図9は、変換例を示す説明図である。OS240が、コンパイラ900をCPU#1に割り当てる。OS241が、コンパイラ900の割り当てを受け付けると、クロック供給回路209のレジスタ221を3に設定することにより、CPU#1に供給されるクロックの周波数がCc=300[MHz]となるように制御する。OS241がコンパイラ900を実行し、コンパイラ900がアプリ#Aのバイトコード701をアプリ#Aのネイティブコード901に変換する。
 OS240が、JavaVM902をCPU#0に割り当てて、クロック供給回路209のレジスタ220を2に設定することにより、CPU#0に供給されるクロックの周波数がC=200[MHz]となるように制御する。OS240が、JavaVM902上でアプリ#Aをアプリ#Aのバイトコード701で実行する。
 図10は、コンパイラ900とアプリ#Aの割り当てによる割り当て管理テーブル400の更新例を示す説明図である。割り当て管理テーブル400のCPUの識別情報の項目401がCPU#0であるアプリの識別情報の項目402にJavaVM:アプリ#Aを登録する。JavaVM:アプリ#Aとは、JavaVM902によってアプリ#Aが実行されていることを示す。割り当て管理テーブル400のCPUの識別情報の項目401がCPU#1であるアプリの識別情報の項目402にコンパイラ900を登録する。
 図11は、コンパイル終了例を示す説明図である。アプリ#Aのバイトコード701からアプリ#Aのネイティブコード901への変換が終了する。コンパイラ900が変換管理テーブル600のアプリの識別情報の項目601がアプリ#Aである変換状態の項目602に完了を登録する。そして、コンパイラ900が終了する。
 図12は、変換終了後の変換管理テーブル600の更新例を示す説明図である。変換管理テーブル600は、アプリの識別情報の項目601がアプリ#Aである変換状態の項目602に完了が登録されている。
 図11に戻って、コンパイラ900が終了すると、他にCPU#1へ割り当てられているアプリケーションのスレッドがないため、OS241がクロック供給回路209のレジスタ221の値を1に設定する。これにより、CPU#1へ与えられるクロックの周波数が100[MHz]となる。OS241が割り当て管理テーブル400のCPUの識別情報の項目401がCPU#1であるアプリの識別情報の項目402からコンパイラ900を削除する。
 OS240が、アプリ#Aのバイトコード701からアプリ#Aのネイティブコード901への変換終了通知を受け付けると、JavaVM902を終了させる。OS240が、クロック供給回路209のレジスタ220の値を1に設定する。これにより、CPU#0へ与えられるクロックの周波数が100[MHz]となる。OS240が、アプリ#Aをアプリ#Aのネイティブコード901で実行する。OS240が、割り当て管理テーブル400のCPUの識別情報の項目401がCPU#0であるアプリの識別情報の項目402からJavaVM:アプリ#Aを削除して、アプリ#Aを登録する。
 図13は、変換終了後の割り当て管理テーブル400の更新例を示す説明図である。割り当て管理テーブル400では、CPUの識別情報の項目401がCPU#1であるアプリの識別情報の項目402からコンパイラ900が削除されている。割り当て管理テーブル400では、CPUの識別情報の項目401がCPU#0であるアプリの識別情報の項目402にアプリ#Aが登録されている。
(ダウンロード時の各OSによる変換制御処理)
 図14は、ダウンロード時の各OSによる変換制御処理手順の一例を示すフローチャートである。ダウンロードに関しては、いずれのOSが行ってもよい。OSが、対象アプリケーションをダウンロードすると(ステップS1401)、コンパイルスケジューラ700を起動する(ステップS1402)。OSが、コンパイルスケジューラ700から決定結果を受け付けたか否かを判断する(ステップS1403)。
 OSが、コンパイルスケジューラ700から決定結果を受け付けていないと判断した場合(ステップS1403:No)、ステップS1403へ戻る。OSが、コンパイルスケジューラ700から決定結果を受け付けたと判断した場合(ステップS1403:Yes)、決定結果がダウンロードしたアプリケーションを変換することを示すか否かを判断する(ステップS1404)。
 OSが、決定結果がダウンロードしたアプリケーションを変換することを示している場合(ステップS1404:Yes)、負荷が小さいCPUにコンパイラ900を割り当て(ステップS1405)、ステップS1406へ移行する。ステップS1404において、OSが、決定結果がダウンロードしたアプリケーションを変換しないことを示している場合(ステップS1404:No)、ステップS1406へ移行する。OSが、ダウンロードしたアプリケーションを負荷が小さいCPUによりJavaVM上で実行し(ステップS1406)、一連の処理を終了する。
(実施例1にかかるコンパイルスケジューラ700による変換制御処理手順)
 図15は、実施例1にかかるコンパイルスケジューラ700による変換制御処理手順の一例を示すフローチャートである。コンパイルスケジューラ700が、対象アプリケーションの実行時間(T)とコード量(Code)を取得し(ステップS1501)、Tc=k×Code+Cを算出し(ステップS1502)、Tn=T-Tcを算出する(ステップS1503)。コンパイルスケジューラ700が、Pと、Pcと、Pnとを取得し(ステップS1504)、Pc×Tc+Pn×Tn<P×Tnであるか否かを判断する(ステップS1505)。
 コンパイルスケジューラ700が、Pc×Tc+Pn×Tn<P×Tnであると判断した場合(ステップS1505:Yes)、ネイティブコードへ変換すると決定する(ステップS1506)。コンパイルスケジューラ700が、Pc×Tc+Pn×Tn<P×Tnでないと判断した場合(ステップS1505:No)、ネイティブコードへ変換しないと決定する(ステップS1507)。コンパイルスケジューラ700が、ステップS1506、ステップS1507のつぎに、決定結果をOSへ通知し(ステップS1508)、一連の処理を終了する。
(各OSによるプログラム実行処理手順)
 図16は、各OSによるプログラム実行処理手順を示すフローチャートである。OSが、ディスパッチまたはスイッチ、または処理終了を検出したか否かを判断する(ステップS1601)。OSが、ディスパッチまたはスイッチ、および処理終了を検出していないと判断した場合(ステップS1601:No)、ステップS1601へ戻る。
 OSが、ディスパッチまたはスイッチを検出したと判断した場合(ステップS1601:ディスパッチまたはスイッチ)、ステップS1602へ移行する。OSが、ディスパッチまたはスイッチされたアプリケーションがネイティブコードへ変換するアプリケーション、またはコンパイラ900であるか否かを判断する(ステップS1602)。OSが、ディスパッチまたはスイッチされたアプリケーションがネイティブコードへ変換するアプリケーション、およびコンパイラ900でないと判断した場合(ステップS1602:No)、クロックの周波数をCbに設定する(ステップS1603)。そして、OSが、JavaVM上でアプリケーションをバイトコードで実行し(ステップS1604)、ステップS1601へ戻る。
 OSが、ディスパッチまたはスイッチされたアプリケーションがネイティブコードへ変換するアプリケーションであると判断した場合(ステップS1602:変換)、ネイティブコードに変換済か否かを判断する(ステップS1605)。OSが、ネイティブコードに変換済でないと判断した場合(ステップS1605:No)、ステップS1603へ移行する。OSが、ネイティブコードに変換済であると判断した場合(ステップS1605:Yes)、クロックの周波数をCnに設定し(ステップS1606)、アプリケーションをネイティブコードで実行し(ステップS1607)、ステップS1601へ戻る。
 OSが、ディスパッチまたはスイッチされたアプリケーションがコンパイラ900であると判断した場合(ステップS1602:コンパイラ)、クロックの周波数をCcに設定する(ステップS1608)。OSが、コンパイラ900を実行し(ステップS1609)、ステップS1601へ戻る。
 OSが、処理終了を検出したと判断した場合(ステップS1601:処理終了)、処理終了が検出されたアプリケーションはコンパイラ900であるか否かを判断する(ステップS1610)。OSが、処理終了が検出されたアプリケーションはコンパイラ900であると判断した場合(ステップS1610:Yes)、変換管理テーブル600を更新し(ステップS1611)、すべてのアプリケーションの処理が終了したか否かを判断する(ステップS1612)。
 OSが、すべてのアプリケーションの処理が終了していないと判断した場合(ステップS1612:No)、ステップS1601へ戻る。OSが、すべてのアプリケーションの処理が終了したと判断した場合(ステップS1612:Yes)、一連の処理を終了する。ステップS1610において、処理終了が検出されたアプリケーションはコンパイラ900でないと判断した場合(ステップS1610:No)、ステップS1612へ移行する。
(実施例2)
 図17は、実施例2にかかる判断例を示す説明図である。実施例2では、PcをY×Pとし、PnをX×Pとする。すなわち、Xは、バイトコードでの実行時の単位時間当たりの消費電力の値に対するネイティブコードでの実行時の単位時間当たりの消費電力の値の比率である。Yは、バイトコードでの実行時の単位時間当たりの消費電力の値に対するコンパイラ900を実行時の単位時間当たりの消費電力の値の比率である。
 グラフ1700では、バイトコードからネイティブコードに変換しつつバイトコードで実行し、変換終了後にネイティブコードで実行する場合の消費電力を示している。グラフ1701では、バイトコードで実行する場合の消費電力を示している。図17については、下記式(4)のように表すことができる。
 P×Tc+Y×P×Tc+X×P×Tn<P×T ・・・(4)
 ここで、TcとTnについてはそれぞれ上述の式(1),(2)により算出される。そして、式(4)はPで共通化されると、下記式(5)の様になる。
 (1+Y)×Tc+X×Tn<T ・・・(5)
 コンパイルスケジューラ700は、式(5)が成り立てば、バイトコードからネイティブコードへ変換すると決定する。コンパイルスケジューラ700は、式(5)が成り立たなければ、バイトコードからネイティブコードへ変換しないと決定する。
 実施例2では、実施例1と同様にアプリ#Aがダウンロードされた場合において、式(3)に代わって前述した式(4)または式(5)が成り立つか否かによって、アプリ#Aのバイトコード701をアプリ#Aのネイティブコード901へ変換するか否かを決定する。実施例2では、OS240やOS241の処理については実施例1で示した処理と同一であるため、コンパイルスケジューラ700の処理のみ詳細に説明する。また、XとYについてはあらかじめ消費電力テーブルに格納されていることとする。
 図18は、実施例2で用いる消費電力テーブルの一例を示す説明図である。消費電力テーブル1800は、実行の項目1801と、クロック周波数の項目1802と、比率の項目1803と、を有している。実行の項目1801には、ネイティブコードでの実行と、バイトコードでの実行と、コンパイラの実行と、が登録されている。クロック周波数の項目1802には、実行の項目1801に登録された実行時にCPUへ供給するクロックの周波数が登録されている。
 消費電力テーブル1800では、コンパイラ900の実行時にCPUへ与えるクロックの周波数(Cc)が300[MHz]であり、ネイティブコードでの実行時にCPUへ与えるクロックの周波数(Cn)は100[MHz]である。消費電力テーブル1800では、バイトコードでの実行時にCPUへ与えるクロックの周波数(Cb)は200[MHz]である。Cn<Cb<Ccである。
 比率の項目1803には、バイトコードでの実行時の単位時間当たりの消費電力と実行の項目1801に登録された実行時の単位時間当たりの消費電力との比率が登録されている。Pc(Y×P)が100[mW]であり、Pn(X×P)が25[mW]であり、Pが50[mW]であるため、消費電力テーブル1800では、X(0<X<1)が1/2であり、Y(1>Y)が2である。消費電力テーブル1800は、RAM206、1次キャッシュ230および1次キャッシュ231、2次キャッシュ211などの記憶装置に記憶されていることとする。
 TcとTnは実施例1と同様に下記とする。
 ・Tc=90[ms]
 ・Tn=410[ms]
 コンパイルスケジューラ700が、消費電力テーブル1800からXとYとを取得し、式(5)を判断する。
 ・式(5)の左辺=(1+2)×90[ms]+(1/2)×410[ms]
 =270+205
 =475
 ・式(5)の右辺=500[ms]
 式(5)の左辺が式(5)の右辺よりも小さいので、式(5)が成り立つため、コンパイルスケジューラ700が、アプリ#Aのバイトコード701をアプリ#Aのネイティブコード901に変換すると決定する。コンパイルスケジューラ700が、決定結果をOSへ通知する。OSが決定結果を受け付け後の処理については実施例1と同一であるため、詳細な説明を省略する。
 つぎに、各OSによるプログラム実行処理手順やコンパイルスケジューラ700によるプログラム変換制御処理手順について説明する。実施例2にかかる各OSのプログラム実行処理手順については実施例1で説明した各OSのプログラム実行処理手順と同一であるため、詳細な説明は省略する。
(実施例2にかかるコンパイルスケジューラ700による変換制御処理手順)
 図19は、実施例2にかかるコンパイルスケジューラ700による変換制御処理手順の一例を示すフローチャートである。コンパイルスケジューラ700が、対象アプリケーションの実行時間(T)と対象アプリケーションのバイトコードのコード量(Code)を取得し(ステップS1901)、Tc=k×Code+Cを算出し(ステップS1902)、Tn=T-Tcを算出する(ステップS1903)。コンパイルスケジューラ700が、XとYを取得し(ステップS1904)、(1+Y)Tc+X×Tn<Tであるか否かを判断する(ステップS1905)。
 コンパイルスケジューラ700が、(1+Y)Tc+X×Tn<Tであると判断した場合(ステップS1905:Yes)、ネイティブコードへ変換すると決定する(ステップS1906)。コンパイルスケジューラ700が、(1+Y)Tc+X×Tn<Tでないと判断した場合(ステップS1905:No)、ネイティブコードへ変換しないと決定する(ステップS1907)。コンパイルスケジューラ700が、ステップS1906、ステップS1907のつぎに、決定結果をOSへ通知し(ステップS1908)、一連の処理を終了する。
 以上説明したように、プログラム実行方法によれば、対象アプリケーションのバイトコードをネイティブコードに変換して対象アプリケーションを実行するか否かを、各コードでの実行時の消費電力の値に基づいて決定する。これにより、消費電力を抑制することができ、ネイティブコードに変換して対象アプリケーションを実行する場合、各端末の性能に沿ったコードでアプリケーションを実行させることができる。
 また、バイトコードでの実行時の消費電力の値が、ネイティブコードでの実行時の消費電力の値よりも小さいとき、対象アプリケーションのバイトコードをネイティブコードに変換せず、対象アプリケーションをバイトコードで実行する。これにより、消費電力を抑制することができる。
 また、ネイティブコードでの実行時の消費電力の値を、対象アプリケーションの実行時間とバイトコードからネイティブコードへの変換時間と、CPUの性能とに基づいて算出する。これにより、各CPUの性能によって異なる単位時間値の消費電力の値によってネイティブコードでの実行時の消費電力の値が変化することが表され、各端末の性能に沿ったコードでアプリケーションを実行させることができる。
 また、変換時間は、バイトコードのコード量に基づいて算出する。これにより、コード量が増えると、コンパイラによる変換時間が長くなるため、ネイティブコードでの実行時に消費電力の値が増加することを表すことができる。したがって、実行前に算出するネイティブコードでの実行時に消費電力の値の精度を向上させることができる。
 また、変換時間は、CPUの特性に基づいて算出する。CPUの特性によってはコンパイラによる変換に時間がかかり変換時間が長くなる。すなわち、端末によって変換時間が変わることが表され、実行前に算出するネイティブコードでの実行時に消費電力の値の精度を向上させることができる。さらに、変換時間が端末によって変わるため、端末の性能によって変換するか否かが異なり、各端末の性能に沿ったコードでアプリケーションを実行させることができる。
 また、バイトコードからネイティブコードへの変換時にCPUへ与えられるクロックの周波数を、バイトコードでの実行時にCPUへ与えられるクロックの周波数よりも高くする。変換とバイトコードでの実行とを同時に行うと消費電力が増大するが、変換時のクロック周波数が高くなることで、変換時間を短縮することができ、消費電力を削減することができる。
 また、ネイティブコードでの実行時にCPUへ与えられるクロックの周波数を、バイトコードでの実行時にCPUへ与えられるクロックの周波数よりも低くする。ネイティブコードでの実行は、バイトコードでの実行よりも処理量が少ないため、ネイティブコードでの実行時にクロックの周波数が低くても、バイトコードでの実行時に要求された動作を満たすことができる。よって、ネイティブコードでの実行時にクロックの周波数を低くすることで、消費電力を抑制することができる。
 また、コンパイルスケジューラが、バイトコードからネイティブコードに変換するか否かを判断することで、OSの実行に負荷がかかるのを防止することができる。
 また、バイトコードからネイティブコードへの変換中に、アプリケーションをバイトコードで実行する。変換終了後にアプリケーションをネイティブコードで実行することにより、ダウンロードしてすぐにアプリケーションを実行させる場合に、ユーザの応答性を向上させることができる。
 なお、プログラム実行方法は、あらかじめ用意されたプログラムをマルチコアプロセッサのうちのいずれかのCPUで実行することにより実現することができる。たとえば、実施例1,2では該プログラムはOS240やOS241やコンパイルスケジューラ700に含まれている。また、該プログラムは、フラッシュROM205などのマルチコアプロセッサのいずれかのCPUが読み取り可能な記録媒体に記録され、マルチコアプロセッサのいずれかのCPUによって記録媒体から読み出されることによって実行されてもよい。また、該プログラムは、インターネット等のネットワークを介して配布されてもよい。
 700 コンパイルスケジューラ
 701 アプリ#Aのバイトコード
 900 コンパイラ
 901 アプリ#Aのネイティブコード
 #0,#1 CPU

Claims (9)

  1.  コンピュータが、
     第1のコードによって記述される第1プログラムの実行時の第1の消費電力を算出し、
     前記第1プログラムと同じ機能を有するとともに第2のコードによって記述される第2プログラムの実行時の第2の消費電力を算出し、
     前記第2の消費電力が前記第1の消費電力よりも小さいとき、前記第1プログラムを前記第2プログラムに変換して前記第2プログラムを実行すること
     を特徴とするプログラム実行方法。
  2.  前記第2の消費電力が前記第1の消費電力よりも大きいとき、前記第1プログラムを実行すること
     を特徴とする請求項1に記載のプログラム実行方法。
  3.  前記第2の消費電力は、
     前記第1プログラムの実行時間、前記第1プログラムを前記第2プログラムに変換するときの変換時間、および前記コンピュータに含まれるCPUの特性に基づいて算出されること
     を特徴とする請求項1または請求項2に記載のプログラム実行方法。
  4.  前記変換時間は、前記第1プログラムの第1のコード量に基づいて算出されること
     を特徴とする請求項3に記載のプログラム実行方法。
  5.  さらに、前記変換時間は、
     前記コンピュータに含まれるCPUの特性に基づいて算出されること
     を特徴とする請求項4に記載のプログラム実行方法。
  6.  前記第1プログラムを前記第2プログラムに変換するときに設定される第2クロックの周波数を、前記第1プログラムを実行するときに設定される第1クロックの周波数よりも高く設定すること
     を特徴とする請求項1乃至請求項5の何れか一に記載のプログラム実行方法。
  7.  前記第2プログラムを実行するときに設定される第3クロックの周波数は、前記第1プログラムを実行するときに設定される第1クロックの周波数よりも低く設定されること
     を特徴とする請求項1乃至請求項6の何れか一に記載のプログラム実行方法。
  8.  コンパイルスケジューラを起動し、
     前記コンパイルスケジューラが前記第1プログラムを前記第2プログラムに変換するか否かを判定すること
     を特徴とする請求項1乃至請求項6の何れか一に記載のプログラム実行方法。
  9.  前記第1プログラムを前記第2プログラムに変換する間に前記第1プログラムを実行し、
     前記変換終了後に前記第2プログラムを実行すること
     を特徴とする請求項1乃至請求項7の何れか一に記載のプログラム実行方法。
PCT/JP2011/052064 2011-02-01 2011-02-01 プログラム実行方法 WO2012105000A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2012555619A JP5505522B2 (ja) 2011-02-01 2011-02-01 プログラム実行方法
PCT/JP2011/052064 WO2012105000A1 (ja) 2011-02-01 2011-02-01 プログラム実行方法
US13/956,710 US9336052B2 (en) 2011-02-01 2013-08-01 Program executing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2011/052064 WO2012105000A1 (ja) 2011-02-01 2011-02-01 プログラム実行方法

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/956,710 Continuation US9336052B2 (en) 2011-02-01 2013-08-01 Program executing method

Publications (1)

Publication Number Publication Date
WO2012105000A1 true WO2012105000A1 (ja) 2012-08-09

Family

ID=46602242

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/052064 WO2012105000A1 (ja) 2011-02-01 2011-02-01 プログラム実行方法

Country Status (3)

Country Link
US (1) US9336052B2 (ja)
JP (1) JP5505522B2 (ja)
WO (1) WO2012105000A1 (ja)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160224325A1 (en) * 2015-01-29 2016-08-04 Mentor Graphics Corporation Hiding compilation latency
JP6631374B2 (ja) * 2016-04-13 2020-01-15 富士通株式会社 情報処理装置、動作状況収集プログラム及び動作状況収集方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001195264A (ja) * 2000-01-07 2001-07-19 Toshiba Corp コンパイル方法および計算機システム
JP2004355277A (ja) * 2003-05-28 2004-12-16 Matsushita Electric Ind Co Ltd プログラム実行制御装置、プログラム実行制御方法
JP2006126947A (ja) * 2004-10-26 2006-05-18 Hitachi Software Eng Co Ltd 情報処理装置、情報処理方法、およびプログラム
JP3808755B2 (ja) * 2001-11-07 2006-08-16 富士通株式会社 Jitコンパイラを備えた仮想計算機
JP2007141153A (ja) * 2005-11-22 2007-06-07 Hitachi Software Eng Co Ltd インタプリタ
JP2009151375A (ja) * 2007-12-18 2009-07-09 Toshiba Corp ジョブスケジューリング方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11232147A (ja) * 1998-02-16 1999-08-27 Toshiba Corp パワーエスティメーション装置、パワーエスティメーション方法、及びパワーエスティメーションプログラムを記録した機械読み取り可能な記録媒体
US7904893B2 (en) * 2004-03-17 2011-03-08 Marvell International Ltd. Power and/or energy optimized compile/execution
JP4231516B2 (ja) * 2006-08-04 2009-03-04 株式会社日立製作所 実行コードの生成方法及びプログラム

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001195264A (ja) * 2000-01-07 2001-07-19 Toshiba Corp コンパイル方法および計算機システム
JP3808755B2 (ja) * 2001-11-07 2006-08-16 富士通株式会社 Jitコンパイラを備えた仮想計算機
JP2004355277A (ja) * 2003-05-28 2004-12-16 Matsushita Electric Ind Co Ltd プログラム実行制御装置、プログラム実行制御方法
JP2006126947A (ja) * 2004-10-26 2006-05-18 Hitachi Software Eng Co Ltd 情報処理装置、情報処理方法、およびプログラム
JP2007141153A (ja) * 2005-11-22 2007-06-07 Hitachi Software Eng Co Ltd インタプリタ
JP2009151375A (ja) * 2007-12-18 2009-07-09 Toshiba Corp ジョブスケジューリング方法

Also Published As

Publication number Publication date
US20130318375A1 (en) 2013-11-28
JP5505522B2 (ja) 2014-05-28
JPWO2012105000A1 (ja) 2014-07-03
US9336052B2 (en) 2016-05-10

Similar Documents

Publication Publication Date Title
Barbalace et al. Breaking the boundaries in heterogeneous-ISA datacenters
Newburn et al. Offload compiler runtime for the Intel® Xeon Phi coprocessor
US9063783B2 (en) Coordinating parallel execution of processes using agents
TW200413889A (en) Mechanism for processor power state aware distribution of lowest priority interrupts
US9167055B2 (en) Method and system of displaying frame
US20110219373A1 (en) Virtual machine management apparatus and virtualization method for virtualization-supporting terminal platform
US20160179429A1 (en) Controlling memory access conflict of threads on multi-core processor with set of highest priority processor cores based on a threshold value of issued-instruction efficiency
US20110173628A1 (en) System and method of controlling power in an electronic device
JP5660149B2 (ja) 情報処理装置、ジョブスケジューリング方法およびジョブスケジューリングプログラム
US10613606B2 (en) Wireless component state based power management
US20130298132A1 (en) Multi-core processor system and scheduling method
US20130125131A1 (en) Multi-core processor system, thread control method, and computer product
US20150194198A1 (en) Multi-core processor system, memory controller control method, and computer product
JP5708450B2 (ja) マルチコアプロセッサシステム、レジスタ利用方法、およびレジスタ利用プログラム
JP5505522B2 (ja) プログラム実行方法
US9588817B2 (en) Scheduling method and scheduling system for assigning application to processor
US20130007765A1 (en) Software control device, software control method, and computer product
US9690619B2 (en) Thread processing method and thread processing system for setting for each thread priority level of access right to access shared memory
US9141429B2 (en) Multicore processor system, computer product, and control method
US7945901B2 (en) System and method for facilitating software profiling procedures
Hsu et al. A dynamic binary translation system in a client/server environment
Alonso et al. Energy-efficient execution of dense linear algebra algorithms on multi-core processors
WO2023225991A1 (en) Dynamic establishment of polling periods for virtual machine switching operations
Zhu et al. Revisiting swapping in mobile systems with SwapBench
KR20030050860A (ko) 다중 프로세서 시스템의 작업 함수 처리 방법

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11857793

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2012555619

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11857793

Country of ref document: EP

Kind code of ref document: A1