WO2012020478A1 - スケジューラ、マルチコアプロセッサシステムおよびスケジューリング方法 - Google Patents

スケジューラ、マルチコアプロセッサシステムおよびスケジューリング方法 Download PDF

Info

Publication number
WO2012020478A1
WO2012020478A1 PCT/JP2010/063588 JP2010063588W WO2012020478A1 WO 2012020478 A1 WO2012020478 A1 WO 2012020478A1 JP 2010063588 W JP2010063588 W JP 2010063588W WO 2012020478 A1 WO2012020478 A1 WO 2012020478A1
Authority
WO
WIPO (PCT)
Prior art keywords
unset
group
thread
processor
scheduler
Prior art date
Application number
PCT/JP2010/063588
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 PCT/JP2010/063588 priority Critical patent/WO2012020478A1/ja
Priority to JP2012528534A priority patent/JP5408356B2/ja
Publication of WO2012020478A1 publication Critical patent/WO2012020478A1/ja
Priority to US13/761,866 priority patent/US9262209B2/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
    • 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/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • 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/4887Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues involving deadlines, e.g. rate based, periodic
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Definitions

  • the present invention relates to a scheduler, a multicore processor system, and a scheduling method for executing an application in a multicore processor.
  • cache miss may occur.
  • the processor reads data necessary for execution of processing from the external memory, and stores new data in the cache as necessary. Processing time is required.
  • the program is analyzed, the inside of the program is divided into a plurality of blocks, and the input / output relationship of the data between the blocks is analyzed to identify a processing block in which processing groups having common data to be used are collected.
  • Technology is also disclosed. For example, since the data used when executing the specified processing block is highly relevant, the cache miss can be reduced by scheduling the data once stored in the cache to be continuously executed (for example, , See Patent Documents 2 and 3 below).
  • FIG. 23 is an explanatory diagram showing continuous execution of a conventional process.
  • FIG. 23 shows an example of the operation of the CPU when each process is continuously executed using the conventional technique.
  • the processes 4, 8, 15, 19, 25, and 29 belonging to the same processing block are set to be continuously executed.
  • step S2301 an external interrupt is generated immediately after the process 4 (step S2301), and an internal interrupt process is also generated (step S2302). Therefore, the data stored in the cache for executing the process 4 is contaminated by the processing in steps S2301 and S2302 (the other data is stored), and when the cache is read when the process 8 is executed. A cache miss will occur.
  • step S2303 Similarly, no interrupt processing has occurred between the processes 8 and 15, but a waiting time occurs because of waiting for synchronization, and a low priority process is executed during the waiting time (step S2303). Then, another process with high priority is executed between the processes 15 and 19 (step S2304). As a result, even if the program is analyzed and set to be continuously executed, it is often not actually executed continuously, and a cache miss may occur as in the conventional case.
  • the process 1 included in a certain application may be executed by the processor # 0, and one of the other processes preceding the process 1 may be executed by another processor (for example, the processor # 1). Then, when there is no other executable process block in the processor # 0, the processor # 0 must wait until the preceding process executed by the processor # 1 is completed.
  • the present disclosure technique aims to provide a scheduler, a multi-core processor system, and a scheduling method capable of efficiently using a cache by reducing the occurrence of standby time in order to solve the above-described problems caused by the conventional technique.
  • the disclosed technology is based on the assumption that a specific processor in a multi-core processor uses an unset scheduling process group common to subsequent process groups as a process group that constitutes a target program. For each unset process of the detected unset process group, the process group is classified into groups that share the same or related access target data among the preceding process groups for the unset process.
  • the present scheduler, multi-core processor system, and scheduling method have the effect of reducing the occurrence of waiting time and using the cache efficiently.
  • FIG. 1 is an explanatory diagram showing an example of a scheduling process according to the present embodiment.
  • the present embodiment by reducing the number of occurrences of the standby time that occurred during the conventional continuous execution, it is possible to reduce both cache misses and maintain the processing efficiency of the processor.
  • the following three processes achieve both reduction of cache misses and maintenance of processor processing efficiency.
  • the execution timing is adjusted and the preceding and succeeding processes are continuously executed in the same processor.
  • a specific processor is used to collectively execute processes that hinder continuous execution.
  • the processing group included in the target program to be executed by the multi-core processor is divided into groups for each processing that uses related data in advance.
  • the processes 1 to 10 are divided into groups 1 to 3 for each process related to data used at the time of execution. Therefore, as shown in FIG. 1, among the four processors of CPUs # 0 to # 3 constituting the multi-core processor system, CPU # 1 is assigned a process belonging to group 1, and CPU # 2 is assigned to group 2. A process belonging to group 3 is assigned to CPU # 3.
  • the timing at which the processing is executed in each processor is further adjusted so that the preceding and succeeding processes can be executed consecutively (the process (1) above).
  • the execution time of processing that shares data used at the time of execution that is, processing that can continuously use data once stored in the cache, is estimated in advance at the design stage.
  • processing is executed so as to reduce the number of occurrences of standby time as much as possible based on the execution time of each processing, the input / output relationship of each processing block, and the information of the group sharing the data. Adjust timing.
  • processes that interfere with continuous execution are collected in a specific processor, whereby each process is executed in the order scheduled by the scheduler (process (2) above).
  • the CPU # 0 is used as a dedicated processor for executing a process that hinders continuous execution.
  • a process that does not belong to any group or a process to which no information related to the group is assigned is assigned to the processor # 0 as a process to be executed. Therefore, a situation in which an interrupt process is assigned to the processors # 1 to # 3 is prevented, and the processors # 1 to # 3 execute a process designated at a timing according to the scheduling.
  • a waiting time may occur until the process is completed.
  • the process of another application is not executed without omission in the waiting time as in the conventional case, but it is determined whether the length of the waiting time is shorter than the specified value or not. Determine whether to execute application processing.
  • the processor does not execute the process of another application if the standby time is short (the process (3) above). Therefore, even if the waiting time occurs, each processor does not execute another process every time. As a result, the number of occurrences of cache misses due to execution of other processes is reduced. Further, if the standby time is long, another process is executed using the standby time, so that the processing efficiency of the processor can be maintained.
  • the process of using the data once stored in the cache is continuously executed, thereby reducing the number of cache misses. Therefore, the cache is effectively used and the processing performance of the processor can be improved.
  • the specific configuration and processing contents of the scheduler that implements the scheduling processing according to this embodiment will be described below.
  • FIG. 2 is a block diagram illustrating an example of a hardware configuration of the multi-core processor system.
  • a multi-core processor system 100 includes a multi-core 201, a ROM (Read-Only Memory) 202, a RAM (Random Access Memory) 203, a magnetic disk drive 204, a magnetic disk 205, an optical disk drive 206, and an optical disk.
  • 207 a display 208, an I / F (Interface) 209, a keyboard 210, a mouse 211, a scanner 212, and a printer 213.
  • Each component is connected by a bus 220.
  • the multi-core 201 includes n CPUs (Central Processing Units) and controls the entire multi-core processor system 100.
  • the ROM 202 stores various programs such as a boot program and a scheduler for realizing a scheduling process.
  • the RAM 203 is used as a work area for the CPU 201.
  • the magnetic disk drive 204 controls reading / writing of data with respect to the magnetic disk 205 according to the control of the CPU 201.
  • the magnetic disk 205 stores data written under the control of the magnetic disk drive 204.
  • the optical disc drive 206 controls reading / writing of data with respect to the optical disc 207 according to the control of the CPU 201.
  • the optical disk 207 stores data written under the control of the optical disk drive 206, or causes the computer to read data stored on the optical disk 207.
  • the display 208 displays data such as a document, an image, and function information as well as a cursor, an icon, or a tool box.
  • a CRT a CRT
  • a TFT liquid crystal display a plasma display, or the like can be adopted.
  • I / F An interface 209 is connected to a network 214 such as a LAN (Local Area Network), a WAN (Wide Area Network), or the Internet through a communication line, and others are connected via this network 214. Connected to other devices.
  • the I / F 209 controls an internal interface with the network 214 and controls data input / output from an external device.
  • a modem or a LAN adapter may be employed as the I / F 209.
  • the keyboard 210 has keys for inputting characters, numbers, various instructions, etc., and inputs data. Moreover, a touch panel type input pad or a numeric keypad may be used.
  • the mouse 211 performs cursor movement, range selection, window movement, size change, and the like.
  • a trackball or a joystick may be used as long as they have the same function as a pointing device.
  • the scanner 212 optically reads an image and takes in the image data into the multi-core processor system 100.
  • the scanner 212 may have an OCR (Optical Character Reader) function.
  • OCR Optical Character Reader
  • the printer 213 prints image data and document data.
  • a laser printer or an ink jet printer can be adopted.
  • FIG. 3 is an explanatory diagram showing an example of queue allocation by the multi-core processor system.
  • a scheduler 200 which is a dedicated program for scheduling processing, is prepared for each CPU.
  • the multi-core processor system 100 uses the scheduler 200 of a specific processor among the four processors to assign a processing group constituting the target program to each processor that executes each processing.
  • the scheduler 0 of the CPU # 0 assigns a processing group constituting the target program to each processor.
  • the scheduling result by the scheduler 0 (which processor executes at which timing) is temporarily stored in a ready queue for each processor.
  • a ready queue for each processor is prepared in the shared memory 300.
  • the shared memory 300 is realized using, for example, the ROM 202, the RAM 203, the magnetic disk 205, the optical disk 207, and the like shown in FIG.
  • Each process once placed in the ready queue is executed by the scheduler 200 of each CPU.
  • FIG. 4 is an explanatory diagram showing an example of a program with dependency information.
  • dependency information is assigned to each process of the process group constituting the program.
  • the information content includes the group to which each process belongs, the preceding process that is dependent on each process, the subsequent process that is dependent on each process, and the execution time of each process. It is included.
  • FIG. 4 describes the data configuration of thread information 401, which is dependency information assigned to each thread 400 as an example of a processing unit.
  • the thread information 401 includes the following information.
  • Thread ID Thread identification information
  • Preceding thread ID list Identification information of the preceding thread having a dependency relationship
  • Subsequent thread ID list Identification information of a succeeding thread having a dependency relationship
  • Continuous execution group ID A group that can be continuously executed without a cache miss Identification information
  • Estimated execution time Estimated time required for execution
  • Elapsed time Elapsed time during execution (varies according to actual execution status)
  • the scheduler 200 can specify the execution order and dependency relations of the thread IDs 0 to ID7.
  • FIG. 5 is a block diagram illustrating an example of a functional configuration of the scheduler.
  • the scheduler 200 includes a first detection unit 501, a second detection unit 502, an allocation unit 503, a calculation unit 504, and a setting unit 505.
  • the functions (first detection unit 501 to setting unit 505) serving as the control unit are, for example, programs stored in a storage device such as the ROM 202, RAM 203, magnetic disk 205, and optical disk 207 shown in FIG. Is executed by a specific CPU in the multi-core 201 or by the I / F 209.
  • the memory 500 is realized by a storage device such as the ROM 202, the RAM 203, the magnetic disk 205, and the optical disk 207 shown in FIG.
  • the first detection unit 501 has a function of detecting a process group that satisfies a specific condition from among the process groups constituting the target program. Specifically, the first detection unit 501 detects, from the target program stored in the memory 500, an unset process group for scheduling that is common to subsequent process groups.
  • the non-scheduled process group is a process that excludes a process that is not executed by the multi-core processor system 100 and a process whose execution timing has been set by scheduling, among the process groups that constitute the target program.
  • processes 10 and 11 are set as processes subsequent to process 4
  • processes 10 and 11 are set as processes subsequent to process 5
  • processes subsequent to process 6 are set.
  • a case where the processes 9 and 12 are set will be described.
  • the first detection unit 501 detects processes 4 and 5 as an unset process group.
  • the detected unset processing group is temporarily stored in a storage area such as the RAM 203, the magnetic disk 205, and the optical disk 207.
  • the second detection unit 502 has a function of detecting a processing group that satisfies a specific condition from among the unset processing groups detected by the first detection unit 501. Specifically, the second detection unit 502 detects a preceding process belonging to the same group for each unset process.
  • processes 1, 2, and 3 are set as the preceding processes in the dependency information.
  • the second detection unit 502 detects a process belonging to the group 1 among the processes 1, 2, and 3.
  • the second detection unit 502 performs all the processes. Is detected. On the other hand, there may be no process belonging to group 1 in the unset process group. In such a case, the second detection unit 502 obtains a detection result that there is no preceding process. The detection result is temporarily stored in a storage area such as the RAM 203, the magnetic disk 205, or the optical disk 207.
  • the assigning unit 503 has a function of assigning each unset process to a processor that executes each unset process. Specifically, the assigning unit 503 assigns the unset process to the processor to which the preceding process detected by the second detecting unit 502 is assigned among the processors in the multi-core processor 201.
  • the assigning unit 503 performs assignment processing so that the process 5 is executed by the same processor as the process 1. That is, when process 1 is allocated to processor # 2, allocation unit 503 allocates process 5 to processor # 2.
  • the allocation unit 503 allocates a processor that executes the process 5 with reference to the past allocation process.
  • the allocation result is temporarily stored in a storage area such as the RAM 203, the magnetic disk 205, and the optical disk 207.
  • the calculation unit 504 has a function of calculating a process end time when actually executed for each unset process. Specifically, the calculation unit 504 calculates the elapsed time of the execution time of the unset process from the execution end time when all preceding process groups for the unset process are completed.
  • the process start time of each unset process is the latest time among the end times of the preceding processes. Then, when the process 4 is started at the latest time among the end times of the preceding processes of the process 4, the execution time of the process 4 (for example, the estimated execution time set in the thread information 401 in FIG. 4) has elapsed. This time becomes the processing end time of processing 4. Similarly, the calculation unit 504 calculates a process end time for the process 5. The calculation result is temporarily stored in a storage area such as the RAM 203, the magnetic disk 205, and the optical disk 207.
  • the setting unit 505 has a function of setting an execution start time in a processor to which an unset process is assigned for each unset process assigned to any processor by the assigning unit 503. Specifically, the setting unit 505 sets a time that goes back the execution time of the unset process from the latest elapsed time calculated by the calculator 504 as the execution start time of the unset process.
  • the calculation unit 504 calculates the process end time T4 of the process 4 and the process end time T5 of the process 5. If T4> T5 (T4 is later), the processes 4 and 5 set the execution start time so as to end at T4. Therefore, the setting unit 505 sets a time that is retroactive to the execution time of the process 4 from T4 as the execution start time of the process 4. Similarly, the setting unit 505 sets the time from the time T4 to the execution time of the process 5 as the execution start time of the process 5.
  • the processes 4 and 5 are completed at the time T4.
  • the processes 4 and 5 have a common subsequent process group. Therefore, since the preceding process is completed at the same time, the succeeding process group can be executed continuously with the preceding process (here, processes 4 and 5) at time T4.
  • the setting unit 505 sets the execution end time T4 as the execution start time of the unset process.
  • the setting unit 505 continuously executes the unset process and the preceding process when a certain unset process can be immediately executed after the preceding process executed by the same processor is completed. As described above, the execution start time of the above-described unset process is set. On the other hand, when the preceding process executed by the same processor is finished and cannot be executed immediately, the setting unit 505 performs the above-described unset process so that the unset process and the subsequent process are continuously executed. Set the execution start time.
  • the setting example described above is the most basic procedure, but the non-set processing group is assumed to have various operating conditions depending on the setting of the preceding process and the subsequent process and the setting of the group to which it belongs. Therefore, hereinafter, a difference in processing between the assigning unit 503 and the setting unit 505 according to a difference in operation status will be described.
  • the setting unit 503 assigns an unset process for which no preceding process has been detected to a processor to which no preceding process is assigned in the multicore 201. That is, the setting unit 503 assigns a free processor to which no processing is assigned.
  • the setting unit 503 assigns an unset process to the processor in the multi-core 201 that has the shortest execution time of the assigned preceding process. That is, the setting unit 505 assigns unset processing to the processor with the lightest processing load.
  • the setting unit 503 is assigned the preceding process detected by the second detection unit 502 with priority given to the non-set process having a higher priority among the non-set processes. Assigned to the processor.
  • an operation situation is assumed in which an interrupt process generated by a program other than the target program and the target program becomes an unset process.
  • the setting unit 503 assigns the processor to which the preceding process belonging to the group to which the unset process belongs is not detected by the second detection unit 502.
  • the assigning unit 503 assigns the unset process generated by the interrupt process to a processor different from the processor to which the preceding process belonging to each group is assigned. Note that when all the processors are assigned with the preceding process belonging to each group, the setting unit 503 performs an interrupt process on the processor of the multi-core 201 that has the shortest execution time of the assigned preceding process. Allocate unset processing that occurred.
  • the assigning unit 503 assigns a process that does not include information specifying the subsequent process group and the preceding process group, such as the thread information 401, to the processor for which the preceding process has not been detected by the second detection unit 502. That is, the setting unit 503 assigns a process to which the thread information 401 is not assigned to a free processor to which no preceding process is assigned. Again, when there is no free processor, the setting unit 503 assigns a process to which the thread information 401 is not assigned to the processor among the multi-core processors 201 that has the shortest execution time of the assigned preceding process.
  • FIG. 6 is a flowchart showing the procedure of the scheduling process.
  • the flowchart in FIG. 6 shows a procedure until the scheduler 200 sets a timing for causing each processor of the multi-core 201 to execute a processing group included in an application to be executed.
  • the scheduler 200 causes each process to be executed at a timing such that an unset process for which execution timing is not set can be continuously executed with a preceding process or a subsequent process having a dependency relationship. be able to.
  • the scheduler 200 determines whether or not there is an unset process group among the process groups constituting the target program to be executed stored in the memory 500 by the first detection unit 501 (Step S ⁇ b> 1). S601). In step S601, the process waits until it is determined that there is an unset process group (step S601: No loop). If it is determined that there is an unset process group (step S601: Yes), the scheduler 200 The 1 detection unit 501 detects an unset process (step S602).
  • the scheduler 200 determines whether or not a processor is assigned to the unset process detected in step S602 (step S603). If it is determined in step S603 that no processor is assigned to the unset process (step S603: No), the scheduler 200 performs a split process for the processor that executes the unset process. Specifically, the scheduler 200 allocates each process to a processor according to the detection result of the second detection unit 502 for the processor being executed by the allocation unit 503 (step S604).
  • step S603 If it is determined in step S603 that a processor has been assigned to the unset process (step S603: Yes), the assigning process in the assigning unit 603 is not necessary, so the scheduler 200 proceeds to the process in step S605 as it is.
  • the scheduler 200 determines whether or not continuous execution can be performed after the preceding process ends (step S605).
  • “Can be executed continuously” means a state in which an unset process can be executed without any waiting time after the preceding process executed by the same processor is completed. In other words, the target processor is in a state where the preceding process executed by another processor has been completed.
  • step S605 When it is determined in step S605 that continuous execution is not possible (step S605: No), the scheduler 200 performs scheduling so that the unset process can be continuously executed with subsequent processes. Therefore, the scheduler 200 first calculates the processing end time by the calculation unit 504 for the unset processing that is common to the subsequent processing detected by the first detection unit 501 (step S606).
  • the scheduler 200 extracts the latest process end time from the process end times calculated in step S606 (step S607). Furthermore, the scheduler 200 calculates an execution start time such that each unset process ends at the process end time extracted in step S607 (step S608).
  • the scheduler 200 sets the unset process by the setting unit 505 to start the process at the execution start time calculated in step S608 (step S609), and ends the series of processes.
  • step S605 determines whether continuous execution is possible (step S605: Yes)
  • the scheduler 200 performs scheduling so that the unset process can be continuously executed with the preceding process. Therefore, the scheduler 200 sets the non-set processing by the setting unit 505 so that it is continuously executed without waiting time after the preceding processing ends (step S610), and the series of processing ends.
  • FIG. 7 is an explanatory diagram showing an example of scheduling using the scheduling process.
  • a scheduling example 701 in FIG. 7 represents a case where the conventional scheduling process is executed, and a scheduling example 702 represents a case where the scheduling process of the scheduler 200 is executed.
  • CPU # 0 executes processing belonging to group 1
  • CPU # 1 executes processing belonging to group 2
  • CPU # 2 executes processing belonging to group 3. .
  • each process has a waiting time each time until reaching the latest time (t1 to t4) among the end times of the preceding processes executed by other processors. It was.
  • each process is scheduled to be continuously executed at least with either the preceding process or the subsequent process. Therefore, even when the same number of processes are executed, the number of occurrences of the standby time is greatly reduced.
  • each processor uses the data once stored in the cache for a long time, so that the processing efficiency can be improved.
  • a thread is implemented as a unit of processing.
  • a thread is a minimum processing unit in the operating system.
  • information such as thread identification information, start time, operating time, and priority is assigned to the thread as management information for management by the operating system.
  • thread information in addition to the normal management information as described above, a list of identification information about the preceding thread that becomes the preceding thread, and a list of identification information about the subsequent thread that becomes the subsequent thread, , Group identification information and thread execution time (for example, expected processing time) are assigned.
  • the preceding thread is an input / output relationship between threads, and is a thread that generates data to be input to this thread.
  • the target thread can be executed.
  • the succeeding thread is a thread that receives data generated by this thread.
  • the group identification information is information indicating a group of threads that share the relevant data specified by analyzing the target program.
  • the thread execution time may be set using the analysis result of the target program, and can be expected by executing the thread in advance and applying the processing time, cache miss rate, and scheduler 200 at that time. It can be obtained from the cache miss rate. Therefore, in the following description of the present embodiment, the thread execution time is referred to as “expected processing time”.
  • the scheduling process by the scheduler 200 is applied to each application executed by the multi-core processor system 100.
  • a conventional thread to which no thread information 401 is assigned is used. Shall be composed.
  • the application to which the scheduling process by the scheduler 200 is applied is composed of a plurality of threads. Further, some or all of the plurality of threads have information on the estimated processing time and / or the identification information of the group to which the preceding thread list and / or subsequent thread list are concerned. Shall.
  • a thread having information on the expected processing time and one or both of the preceding thread list and the succeeding thread list is referred to as “thread having dependency information”, and the conventional thread is referred to as “thread having no dependency information”.
  • a thread having group identification information is a thread belonging to the group, and a thread having the same group identification information is a thread belonging to the same group.
  • the operating system operates to start an application. Further, the operating system activates a main thread in the application. When there are multiple threads at the time of activation, the thread is activated from the main thread. Then, the threads are sequentially started in the form of starting other threads from the started main thread. Further, when there is a thread to which dependency information is assigned in the application, a thread having the dependency information is activated collectively from any of the threads to which no dependency information is assigned.
  • the operating system determines a processor to which the thread is assigned and adds the thread to the data structure in the shared memory 300 that stores an executable thread group called a ready queue corresponding to the processor. .
  • the scheduler 200 assigns threads belonging to the same group to the same processor by the assignment process shown in FIG. 8 below.
  • the allocation process not only threads belonging to the same group are allocated to the same processor, but also thread allocation destinations can be determined so that the processing amount of each processor is as uniform as possible.
  • FIG. 8 is a flowchart illustrating a procedure of processor assignment processing in the embodiment.
  • the flowchart in FIG. 8 shows a procedure until the scheduler 200 assigns a thread constituting an application to each processor by the multi-core processor.
  • the scheduler 200 assigns a thread constituting an application to each processor by the multi-core processor.
  • the time required for execution of each group is referred to, and the threads are allocated in order from the thread included in the group having a long processing time. Therefore, it is possible to perform allocation so that each thread can be executed efficiently.
  • the scheduler 200 first calculates the total expected processing time for each group (step S801). Subsequently, the scheduler 200 determines whether or not there is an unassigned group (step S802).
  • step S802 If it is determined in step S802 that there is an unassigned group (step S802: Yes), the scheduler 200 selects a processor having the smallest total estimated processing time of assigned threads (step S803). Thereafter, the scheduler 200 assigns all the threads of the group having the largest total estimated processing time to the processor selected in Step S803 (Step S804).
  • steps S802 to S804 described above a process for assigning a processor for executing an actual process for an unassigned group is performed. If it is determined in step S802 that there is no unassigned group, the process proceeds to processing for assigning to each processor for the thread described below.
  • step S802 determines whether there is an unassigned thread (step S805). That is, in step S805, the scheduler 200 determines whether it is possible to assign a processor to be executed for each thread belonging to the group assigned to each processor.
  • step S805 If it is determined in step S805 that there is an unassigned thread (step S805: Yes), the scheduler 200 selects a processor having the smallest total estimated processing time of assigned threads from among the processors (step S805: Yes). Step S806).
  • the scheduler 200 assigns the thread with the longest expected processing time among the unassigned threads to the processor selected in step S806 (step S807). After that, when it is determined in step S805 that there is an unassigned thread, the scheduler 200 repeats the processing in steps S806 and S807, and when it is determined that there is no unassigned thread (step S805: No), a series of End the allocation process.
  • the operating system causes the scheduler 200 to execute the thread scheduling process.
  • the scheduler 200 looks at the priority order of the threads.
  • the scheduling process of FIG. The scheduling process in each processor is performed by the scheduler 200 corresponding to each ready queue.
  • Each processor also has a data structure (execution group information) for storing identification information of the currently executing group, and a flag (no_wait flag) indicating whether the currently executing thread has adjusted the time. Is set to
  • FIG. 9 is a flowchart illustrating the procedure of the scheduling process in the embodiment.
  • the flowchart of FIG. 9 shows a procedure for setting the execution timing of the thread assigned to each processor by the scheduler 200.
  • the execution of each process in FIG. 9 can reduce the occurrence of waiting time between threads.
  • the scheduler 200 first determines whether or not group information for a thread being executed by each processor is set (step S901). If it is determined in step S901 that group information is not set (step S901: No), the scheduler 200 selects the highest priority thread from the ready queue (step S902). Then, the scheduler 200 determines whether there is no dependency information in the selected thread in step S902 and the priority is higher than the thread belonging to the group (step S903).
  • step S903 If it is determined in step S903 that the selected thread has no dependency information and has a higher priority than the thread belonging to the group (step S903: Yes), the scheduler 200 executes the selected thread (step S904) and performs scheduling. Exit. On the other hand, if it is determined in step S903 that there is dependency information in the selected thread or the priority is not high (No in step S903), the scheduler 200 determines whether there is an executable thread in the group. (Step S905).
  • step S905 If it is determined in step S905 that there is an executable thread in the group (step S905: Yes), the scheduler 200 determines whether or not the no_wait flag is set for the executable thread (step S906). .
  • Step S906 when it is determined that the no_wait flag is set (Step S906: Yes), the scheduler 200 cancels the no_wait flag (Step S907). Then, the scheduler 200 selects and executes the thread with the longest expected processing time among the executable threads in the group (step S908), and ends the scheduling.
  • step S906 If it is determined in step S906 that the no_wait flag is not set (step S906: No), the scheduler 200 performs a delay time process (step S909), sets the delay to be started, and then performs step S915. Move on to processing.
  • step S905 determines whether there is a thread for which delayed activation is set (step S910). ). If it is determined in step S910 that there is a thread for which delayed activation is set (step S910: Yes), the scheduler 200 proceeds to the process of step S915.
  • step S910 when it is determined in step S910 that there is no thread for which delayed activation is set (step S910: No), the scheduler 200 further determines whether or not the no_wait flag is set for the thread (step S910). S911). If it is determined in step S911 that the no_wait flag is set (step S911: Yes), the scheduler 200 executes the idle thread (step S912) and ends the series of processes.
  • step S911 If it is determined in step S911 that the no_wait flag is not set (step S911: No), the scheduler 200 performs group determination processing (step S913) and delay time setting processing (step S914). Transition to processing.
  • step S910 When the delay time setting process is performed or when it is determined in step S910 that there is a thread for which delay activation is set, the scheduler 200 determines whether the minimum time until delay activation is equal to or less than a specified value. (Step S915). In step S ⁇ b> 915, the scheduler 200 determines whether to execute a thread constituting another application during the standby time until delayed activation.
  • step S915 If it is determined in step S915 that the minimum time is equal to or less than the specified value (step S915: Yes), the scheduler 200 executes the idle thread (step S916) and ends the series of processes. On the other hand, if it is determined in step S915 that the minimum time is not less than the specified value (step S915: No), the scheduler 200 selects and executes the highest priority thread without dependency information from the ready queue ( Step S917), a series of processing ends.
  • FIG. 10 is a flowchart illustrating the procedure of the group determination process in the embodiment.
  • the flowchart of FIG. 10 shows the detailed processing contents of step S913 of the scheduling processing described in FIG.
  • a group of processes for which a group has not been determined can be determined.
  • the scheduler 200 first selects all threads with dependency information in the ready queue (step S1001). Thereafter, the scheduler 200 determines whether or not any thread is selected in step S1001 (step S1002).
  • step S1002 when no thread is selected (step S1002: No), the scheduler 200 deletes the group information being executed by the processor (step S1003). Furthermore, the scheduler 200 selects and executes the thread with the highest priority from the ready queue (step S1004), and ends the series of processes.
  • step S1002 when a thread is selected in step S1002 (step S1002: Yes), the scheduler 200 analyzes all the dependencies of the selected thread and selects all executable threads (step S1005). Then, the scheduler 200 determines whether or not any thread has been selected in step S1005 (step S1006).
  • step S1006 If no thread is selected in step S1006 (step S1006: No), the scheduler 200 selects and executes the highest priority thread without dependency information from the ready queue (step S1007), and ends the series of processes. To do.
  • step S1006 when a thread is selected in step S1006 (step S1006: Yes), the scheduler 200 further determines whether there is a thread belonging to the group in the selected thread (step S1008).
  • step S1008 If it is determined in step S1008 that there is a thread belonging to the group (step S1008: Yes), the scheduler 200 selects and executes the thread having the longest expected processing time from the threads selected in step S1005 (step S1009). ), A series of processing ends.
  • step S1008 If it is determined in step S1008 that there is no thread belonging to the group (step S1008: No), the scheduler 200 selects all the groups to which the thread in the thread selected in step S1005 belongs (step S1010). Furthermore, the scheduler 200 calculates the total expected processing time for each group selected in step S1010 (step S1011). After that, the scheduler 200 selects the group having the largest total estimated processing time calculated in step S1011 as the group being executed (step S1012), and ends the series of processes.
  • FIG. 11 is a flowchart illustrating the procedure of the delay time setting process in the embodiment.
  • the flowchart in FIG. 11 shows the detailed procedure of the delay time setting process in steps S909 and S914 in FIG.
  • the scheduler 200 selects an executable thread from the group to which the process currently being executed by the processor belongs (step S1101). Thereafter, the scheduler 200 selects all subsequent threads in the same group of the thread selected in step S1101 from the ready queues to be processed (step S1102).
  • the scheduler 200 determines whether or not a thread according to the condition in step S1102 has been selected (step S1103). If no thread is selected in step S1103 (step S1103: No), the scheduler 200 does not need to set a delay time. Therefore, the scheduler 200 executes the executable thread selected in step S1101 (step S1104) and ends the series of processes.
  • step S1103 when a thread is selected in step S1103 (step S1103: Yes), the scheduler 200 selects all preceding threads of the thread group selected in step S1102 from all ready queues (step S1105). Furthermore, the scheduler 200 selects all unexecuted threads from the threads selected in step S1105 (step S1106).
  • the scheduler 200 determines whether or not there is only an executable thread in the selected thread (step S1107). If it is determined in step S1107 that only executable threads exist (step S1107: Yes), the scheduler 200 selects a thread having the maximum remaining processing time from the threads selected in step S1105 (step S1108). ).
  • the scheduler 200 calculates a time obtained by subtracting the expected processing time of the executable thread selected in step S1101 from the processing time of the thread selected in step S1108 (step S1109). Then, the scheduler 200 determines whether or not the calculation time calculated in step S1109 is a value greater than 0 (step S1110).
  • step S1110 If it is determined in step S1110 that the calculation time is larger than the calculated time (step S1110: Yes), the scheduler 200 proceeds to a standby time setting process. Therefore, the scheduler 200 sets the executable thread selected in step S1101 to sleep for the calculation time of step S1109 (step S1111), and ends the series of processes.
  • step S1110 determines whether the calculation time is not a value greater than 0 (step S1110: No). If it is determined in step S1110 that the calculation time is not a value greater than 0 (step S1110: No), the scheduler 200 does not need to set the waiting time, and therefore sets the no_wait flag to true ( Step S1112). Thereafter, the scheduler 200 executes the executable thread selected in step S1101 (step S1113), and ends the series of processes.
  • step S1107 when it is determined in step S1107 that only an executable thread does not exist (step S1107: No), the scheduler 200 shifts the processing target to a thread in another group. Therefore, the scheduler 200 determines whether there is another group of threads assigned to the processor in the thread selected in step S1106 (step S1114).
  • step S1114 If it is determined in step S1114 that there is a thread in another group (step S1114: Yes), the scheduler 200 executes the executable thread selected in step S1101 (step S1104), and ends the series of processes. To do.
  • step S1114 when it is determined in step S1114 that there is no thread in another group (step S1114: No), the scheduler 200 selects a thread with the maximum expected processing time from the threads selected in step S1106 (Ste S1115). Thereafter, the scheduler 200 determines whether or not the number of threads selected in step S1115 is equal to the number of executable threads selected in step S1101 (step S1116).
  • step S1116 If it is determined in step S1116 that the number of threads is equal (step S1116: Yes), the scheduler 200 proceeds to the process of step S1108. On the other hand, if it is determined in step S1116 that the numbers of threads are not equal (step S1116: No), the scheduler 200 starts execution of the thread selected in step S1115. Executable conditions are set (step S1117), and a series of processing ends.
  • the application can be efficiently executed in the multi-core processor system 100 by performing the scheduling process as described above.
  • the scheduling process as described above.
  • a specific operation example when various applications are executed by the multi-core processor system 100 described in this embodiment will be described.
  • Example 1 In the execution example 1, as an example of a typical application, the execution contents when 10 thread groups having dependency information (thread group 1 described later) are started will be described. Note that the multi-core processor system 100 that executes the first execution example includes four cores of the processors # 0 to # 3. The thread group 1 to be executed by the multi-core processor system 100 is divided into four groups 1 to 4. Therefore, the scheduler 200 can assign different groups of threads to each processor.
  • FIG. 12 is an explanatory diagram showing the configuration of the thread group 1. As illustrated in FIG. 12, the thread group 1 includes 10 threads ID1 to ID10. Each thread is given the following information as dependency information in addition to the ID for identifying the thread.
  • FIG. 13 is an explanatory diagram showing an example of queue assignment for thread group 1.
  • the thread group 1 is placed in the ready queue of each processor as shown in FIG. Specifically, thread IDs 1, 2, and 6 are assigned to the processor # 0. Further, thread IDs 3, 7, and 10 are assigned to the processor # 1. Furthermore, thread IDs 4 and 8 are assigned to the processor # 2. Then, thread IDs 5 and 9 are assigned to the processor # 3.
  • FIG. 14 is an explanatory diagram showing an example of a route for scheduling processing
  • FIG. 15 is an explanatory diagram showing an example of a route for group determination processing
  • FIG. 16 is an explanatory diagram showing an example of a route for delay time setting processing.
  • FIG. 14 In the following description of the execution example, specific execution contents will be described with a route indicating the execution procedure of each process shown in FIGS.
  • each scheduler 200 refers to the dependency information of each thread and sets the execution timing.
  • the thread group 1 first, in the processor # 0, the thread ID 1 having no preceding thread is executed through the route 1-1 shown in FIG. 14 and the route 2-1 shown in FIG. 15.
  • the scheduler 200 searches for a ready queue that holds a subsequent thread when a thread having a dependency relationship ends. Furthermore, the scheduler 200 notifies the scheduling request from the processor # 0 to the other processors (processors # 1 to # 3) so that the processor associated with the ready queue also performs scheduling.
  • Processor # 0 can execute thread ID2 when thread ID1 ends. However, at the time when the thread ID 1 is finished, the group being executed is not yet set. Therefore, the scheduler 200 determines the group 1 as an executing group in the processor # 0 via the route 1-1 in FIG. 14 and the route 2-3 in FIG.
  • a thread ID 6 that belongs to the same group as the thread subsequent to the thread ID 2 is assigned to the processor # 0. Therefore, the scheduler 200 goes through the route 3-1 in FIG. Therefore, the execution times of the threads that have not yet started executing among the preceding threads with the thread ID 6 are compared.
  • the scheduling of the thread IDs 2 to 5 as the subsequent threads of the thread ID 1 is executed almost simultaneously in each processor because the thread ID 1 is terminated. Therefore, at the moment when the above-described route 3-1 is executed, if none of the thread IDs 2 to 5 that can be executed by the termination of the thread ID 1 has been started, the processing time is the longest.
  • the thread is thread ID3. Therefore, the scheduler 200 sets the execution start of the thread ID 3 as the executable condition of the thread ID 2 through the route 3-2 of FIG.
  • the scheduler 200 of the processor # 1 goes through the route 1-1 in FIG. 14, the route 2-3 in FIG. 15, and the route 3-1 in FIG.
  • the executable thread ID 3 has the longest expected processing time among the preceding threads of the succeeding thread 7 belonging to the same group. Therefore, the scheduler 200 schedules the thread ID 3 to be executed via the route 3-3 in FIG.
  • the scheduler # 3 of the processor # 3 is before the start of the thread ID3, the execution start of the thread ID3 is set as an executable condition of the thread ID5 as in the case of the processor # 0.
  • the scheduler 200 of the processor # 3 sets delayed activation through the route 3-4 in FIG. 16 if the thread ID3 is started.
  • each processor can adjust the delayed activation of threads by using a conventional scheduling technique. For example, if a function such as usleep provided by an existing operating system is used, delayed activation can be easily realized. Therefore, although a description of a specific method for realizing delayed activation is omitted, a thread for which delayed activation is set is temporarily removed from the ready queue as sleeping, and returned to the ready queue after the delay time has elapsed.
  • the execution content of the scheduler 200 of the processor # 2 differs depending on the timing of performing the scheduling process. Specifically, at the time of scheduling processing, the scheduler 200 sets the execution start of the thread ID 3 to the executable condition of the thread ID 4 via the route 3-2 in FIG. 16 if the thread ID 3 is not executed. In addition, if the thread ID 3 is being executed and the thread ID 5 is not executed during the scheduling process, the scheduler 200 sets the execution start of the thread ID 5 as an executable condition of the thread ID 4 even through the route 3-2 in FIG.
  • the scheduler 200 sets a delay time via the route 3-3 and the route 3-4 in FIG. That is, the thread ID 4 is put to sleep for the delay time.
  • each thread that has been set with the start condition of the thread ID 3 as an executable condition can be executed again. Therefore, since the group has already been determined, the scheduler 200 performs the delay time setting process via the route 1-2 in FIG. In the delay time setting process, the scheduler 200 goes through routes 3-1 to 3-4 in FIG. When the number of unexecuted threads decreases, the scheduler 200 executes the target thread, sleeps, or starts another thread again through the route 3-5 in FIG. Set either to wait and do either process.
  • the scheduler 200 When the execution of the thread ID 2 is completed in the processor # 0, the scheduler 200 performs scheduling again. At this time, since the no_wait flag of the target thread is true, if there is a thread that can be executed in the same group, the scheduler 200 immediately executes the target thread via the route 1-3 in FIG. Even if the no_wait flag is not true, the other preceding thread will be terminated soon, so the scheduler 200 executes the idle thread so as not to disturb the cache via the route 1-4 in FIG. Wait for the thread to finish. The processing described above is similarly executed in the schedulers 200 of the processors # 1 to # 3.
  • the scheduler 200 When the scheduling process for the thread IDs 6 to 9 is completed, the scheduler 200 finally starts the scheduling process for the thread ID 10 as the target thread. Since the thread ID 10 does not belong to any group, when all the preceding threads are terminated, the scheduler 200 determines that there is no unexecuted thread belonging to the group at the end timing. Therefore, the scheduler 200 causes the thread ID 10 to be executed via the route 1-5 in FIG. 14 and the route 2-1 in FIG.
  • the scheduler 200 of the processor # 1 to which the thread ID 10 is assigned has no other thread for which dependency information is set. Therefore, the route 1-5 in FIG. 14 and the route 2 in FIG. After step 4, the group information being executed is deleted. Similarly, in the scheduler 200 of another processor, when the thread IDs 6, 8, and 9 are terminated, the group information being executed is deleted via the route 1-5 in FIG. 14 and the route 2-4 in FIG.
  • the scheduler 200 executes a thread for which dependency information is not set. If the target thread is still sleeping even after the executed thread is terminated, the scheduler 200 attempts to execute another thread through the route 1-6 in FIG. If a thread with a high priority is executed during execution of application software with dependency information due to an interrupt or another application software, the scheduler 200 performs scheduling via the route 1-7 in FIG. Do.
  • FIG. 17 is an explanatory diagram showing an execution result (four processors) of the thread group 1.
  • the multi-core processor system 100 having four processors is executed for the thread group 1 as in the execution example 1, scheduling in the order illustrated in FIG. 17 is performed.
  • Thread ID10 which is a thread subsequent to thread ID8, has finished thread IDs 6 to 9, which are the preceding processes, at the time when execution becomes possible. Therefore, the thread ID 10 is immediately executed after the thread ID 8 that is the preceding process of the same processor is completed.
  • the thread IDs 2 to 5 that are subsequent threads of the thread ID 1 are scheduled for the execution start times of the thread IDs 2, 4, and 5 with reference to the execution end time of the thread ID 3 with the longest pre-processing time.
  • the thread IDs 6 to 9 that are subsequent threads of each thread are scheduled by the scheduler 200 to be executed continuously without any waiting time.
  • execution example 2 an execution example of the thread group 2 (see FIG. 18) having a more complicated configuration than the thread group 1 executed in the execution example 1 will be described. Similar to execution example 1, execution example 2 uses multi-core processor system 100 having four cores of processors # 0 to # 3. Thread group 2 to be executed has dependency information 18. A thread group.
  • FIG. 18 is an explanatory diagram showing the configuration of the thread group 2. As illustrated in FIG. 18, the thread group 2 includes 18 threads having IDs 1 to 18. Each thread is given dependency information in addition to the ID for identifying the thread, as in the thread group 1.
  • FIG. 19 is an explanatory diagram showing an example of queue allocation for thread group # 2.
  • the thread group is placed in the ready queue of each processor as illustrated in FIG. 19.
  • thread IDs 1, 2, 6, 10, and 14 are assigned to the processor # 0.
  • thread IDs 3, 7, 11, 15, and 18 are assigned to the processor # 1.
  • thread IDs 4, 8, 12, and 16 are assigned to the processor # 2.
  • thread IDs 5, 9, 13, and 17 are assigned to the processor # 3.
  • execution example 2 as well, specific execution contents will be described with a route indicating the execution procedure of each process shown in FIGS.
  • the thread IDs 1 to 9 are scheduled through the same procedure as in execution example 1. Therefore, the scheduling after the thread ID 10 will be described.
  • the thread IDs 10 to 13 can be executed at the timing when the thread ID 8 having the longest expected processing time among the preceding threads ends.
  • the scheduler 200 sets the execution timing through the same procedure as the thread IDs 2 to 5.
  • the thread ID 12 can be executed by the end of the processing of the same group performed immediately before by the same processor. Therefore, the scheduler 200 can immediately execute the thread ID 12 without adjusting the time through the route 1-7 of FIG.
  • the thread IDs 14, 15, and 17 are immediately executed by the scheduler 200 because the no_wait flag is set.
  • the thread ID 16 is originally subject to time adjustment because the no_wait flag is not set.
  • the scheduler 200 schedules the thread ID 16 to be executed immediately via the route 1-5 in FIG. 14, the route 2-3 in FIG. 15, and the route 3-6 in FIG.
  • the scheduler 200 executes the execution start time so that the thread ID 16 ends in accordance with the end time of the thread ID 17 having a long processing time. Adjust. This time, since the no_wait flag is set only for the subsequent thread of the thread ID 16, the thread ID 16 is immediately executed.
  • FIG. 20 is an explanatory diagram showing an execution result (four processors) of the thread group 2. As shown in the execution example 2, when the multicore processor system 100 including four processors is executed for the thread group 2, scheduling in the order illustrated in FIG. 20 is performed.
  • Thread IDs 1 to 9 are scheduled to be executed at the same timing as execution example 1. For other subsequent threads, the execution start times of the thread IDs 10, 11, and 13 are scheduled based on the execution end time of the thread ID 13. As a result, since the thread IDs 10, 11, and 13 are terminated at the same time (the thread ID 12 has already been terminated), the thread IDs 14 to 17 that are subsequent threads of the respective threads are set by the scheduler 200 without any waiting time. Scheduled to run continuously.
  • Example 3 In an execution example 3, an execution example in the case where a plurality of groups of threads are assigned to one processor will be described. In execution examples 1 and 2, the case where threads belonging to one group are assigned to one processor has been described. However, in execution example 3, the number of processors is smaller than the number of groups, and a plurality of groups are assigned to one processor. The case will be described. Specifically, a case where a thread having a dependency as shown in FIG. 8 is executed by two processors will be described.
  • FIG. 21 is an explanatory diagram showing an example of queue allocation for the thread group 1 when the number of processors is small.
  • execution example 3 when the multi-core processor system 2100 executes the assignment process of FIG. 8, the threads belonging to group 1 and group 3 are assigned to processor # 0, group 2 and group 4 as shown in FIG. Each thread to which it belongs is assigned to processor # 1.
  • the thread ID 1 is scheduled to be executed by the processor # 0 as the preceding process, similarly to the execution examples 1 and 2.
  • processor # 0 can execute two threads, thread ID2 belonging to group 1 and thread ID4 belonging to group 3.
  • the scheduler 200 first selects a group to be executed by the processor # 0. Specifically, the scheduler 200 selects the group 3 having a large total execution time via the route 1-1 in FIG. 14 and the route 2-3 in FIG. Therefore, the scheduler 200 sets a delay time of the executable thread ID 4 in the group 3.
  • the scheduler 200 cannot continuously execute the thread ID 4 and the thread ID 8. Therefore, the scheduler 200 sets the thread ID 4 to be executed immediately without delay through the route 3-7 of FIG.
  • the scheduler 200 passes the route 1-5 in FIG. 14 and the route 2-3 in FIG. Delay activation is set for thread ID2. Note that, among the preceding threads of thread ID6, which is the subsequent thread in the same group of thread ID2, thread ID3 is the maximum expected processing time among the unexecuted threads. Therefore, the scheduler 200 changes the executable condition of the thread ID 2 to start execution of the thread ID 3.
  • the scheduler 200 sets the expected processing time of the thread ID3 ⁇ the predicted processing time of the thread ID2 (result of the subtraction process) as the delay time.
  • Thread IDs 6 and 7 have a no_wait flag set. Therefore, the scheduler 200 can immediately execute the above-described threads. Furthermore, since the thread IDs 8 and 9 do not belong to the same group as the thread ID 10 that becomes the subsequent thread, the scheduler 200 can execute the thread IDs 8 and 9 immediately after the thread IDs 6 and 7 are finished.
  • FIG. 22 is an explanatory diagram showing an execution result (two processors) of a thread group 1 in a multi-core processor having a small number of processors.
  • the multi-core processor system 2100 having two processors is executed for the thread group 1 as in the execution example 3, scheduling in the order illustrated in FIG. 22 is performed.
  • the scheduler 200 performs scheduling so that threads of the same group are continuously executed as much as possible.
  • an unset process that has not been scheduled cannot be immediately executed after the preceding process executed by the same processor is completed.
  • it is possible to set the execution start time of the above-described unset process so that the unset process and the subsequent process are continuously executed. Therefore, a situation in which a waiting time between an unset process and a subsequent process occurs is avoided, so that the processing efficiency of the processor can be improved.
  • the execution start time of the above-described unset process can be set so that the preceding process is continuously executed. Therefore, a situation in which a waiting time between the unset process and the preceding process occurs is avoided, so that the processing efficiency of the processor can be improved.
  • an unset process when there is no preceding process belonging to the same group, an unset process can be assigned to an empty processor that is not executing the process. Further, when there is no free processor, it is possible to assign an unset process to the processor with the lightest load in consideration of the execution time of the process assigned to each processor. Therefore, since the load on each processor is distributed, efficient processing can be realized.
  • a process with higher priority ranking an interrupt process, a process to which no dependency information indicating a preceding process or a subsequent process is assigned is assigned to a preferentially set processor. Can be assigned. Therefore, since processing with a high priority is executed by a specific processor, it is possible to prevent the occurrence of interrupt processing during continuous execution and suppress cache misses.
  • the standby time occurs due to scheduling, if the standby time is shorter than a specified value (an arbitrary threshold value can be set), other conventional methods are used. It can also be set not to execute the processing of the program. Therefore, it is possible to prevent a situation in which the data stored in the cache is changed due to the occurrence of the waiting time. Further, by limiting to the case where the standby time is short, it is possible to adjust so that the processing efficiency of the processor does not decrease more than necessary.
  • a specified value an arbitrary threshold value can be set
  • the scheduling method described in the present embodiment can be realized by executing a program prepared in advance on a computer such as a personal computer or a workstation.
  • the scheduler is recorded on a computer-readable recording medium such as a hard disk, a flexible disk, a CD-ROM, an MO, and a DVD, and is executed by being read from the recording medium by the computer.
  • the scheduler may be distributed via a network such as the Internet.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Debugging And Monitoring (AREA)

Abstract

 本実施の形態では、スケジューラ(200)は、各プロセッサにおいて処理を実行する際のタイミングを、前後の処理同士が連続して実行できるように調整する。また、外部割り込みや内部割り込みなど連続実行に邪魔な処理を特定のプロセッサにまとめることによって、スケジューラ(200)がスケジューリングした順序で各処理が実行される。さらに、スケジューラ(200)は、待機時間に漏れなく他のアプリケーションのプロセスを実行させるのではなく、待機時間の長さが規定値よりも短いか否かを判断し、短い時間であれば、他のアプリケーションのプロセスを実行させない。

Description

スケジューラ、マルチコアプロセッサシステムおよびスケジューリング方法
 この発明は、マルチコアプロセッサにおいてアプリケーションを実行させる際のスケジューラ、マルチコアプロセッサシステムおよびスケジューリング方法に関する。
 従来より、プロセッサの処理効率を上げるため、キャッシュを有効利用する技術が多数提供されている。あるプログラムを実行する場合、プロセッサには、タスクやスレッドなどプログラムを構成する所定の単位の処理が割り当てられる。そして、各プロセッサでは、割り当てられた処理が順次実行される。また、各プロセッサに備えられたキャッシュには、プロセッサが割り当てられた処理を実行する際に利用するデータが格納される。したがって、各プロセッサは、関連するデータを利用する処理が連続して割り当てられれば、一旦キャッシュに格納されたデータを連続して利用できる。
 反対に、利用するデータが異なる処理が連続して割り当てられてしまうと、キャッシュに格納されているデータを連続して利用することができず、いわゆるキャッシュミスが発生してしまうことがあった。キャッシュミスが発生した場合、プロセッサは、処理の実行に必要なデータを外部のメモリから読み出し、必要に応じて新たなデータをキャッシュに格納するため、キャッシュを利用できた場合と比較して多くの処理時間を要してしまう。
 そこで、あらかじめ、一旦キャッシュに格納したデータを使用する処理を連続して実行させるように、処理の実行順序を調整しておくことによって、キャッシュミスを削減し、プロセッサの処理性能を向上させる技術が開示されている(例えば、下記特許文献1参照。)。
 さらに、プログラムを解析して、プログラム内部を複数のブロックに分割するとともに、各ブロック間のデータの入出力関係を解析することによって、利用するデータが共通する処理群を集めた処理ブロックを特定する技術も開示されている。例えば、特定された処理ブロックを実行する際に利用するデータは、関連性が高いため、一旦キャッシュに格納したデータを連続実行するようにスケジューリングされることによって、キャッシュミスの削減が期待できる(例えば、下記特許文献2,3参照。)。
特開2006-99156号公報 特開平10-134030号公報 特開2004-252728号公報
 しかしながら、従来技術を利用して、キャッシュミスの発生を抑えるには限界があった。例えば、各処理ブロックの入出力関係が、1対1ではなく1つの処理ブロックに複数の処理ブロックのデータを必要とする場合は、同じ複数の処理ブロックを実行させなければならないため、同じ処理ブロックに属する処理だけを連続実行させることはできない。また、依存関係が複雑なプログラムを実行させる場合や、優先度の高い処理や外部処理の割り込みが発生する場合にも、連続実行していた処理とは異なるデータを利用する可能性が高く、キャッシュミスの発生は避けられなかった。
 図23は、従来のプロセスの連続実行を示す説明図である。図23は、従来の技術を利用して各プロセスを連続実行させた場合のCPUの動作の一例を表している。従来の技術を利用して、同じ処理ブロックに属するプロセス4,8,15,19,25,29が連続実行するように設定されている。
 ところが、実際には図23に例示したように、プロセス4の直後に外部割り込みが発生し(ステップS2301)、さらに、内部的な割込処理も発生してしまっている(ステップS2302)。したがって、プロセス4を実行するためにキャッシュに格納されたデータは、ステップS2301,S2302の処理によって汚されてしまい(他のデータが格納された状態)、プロセス8を実行する際にキャッシュを読み込むとキャッシュミスを起こしてしまう。
 同様に、プロセス8,15の間には割込処理こそ発生していないが、同期待ちのため待機時間が発生し、待機時間には低優先度のプロセスが実行される(ステップS2303)。そして、プロセス15,19の間には、高優先度の別プロセスが横入りして実行されている(ステップS2304)。結果としてプログラムを解析して連続実行するように設定しても、実際には連続実行されないことも多く、キャッシュミスは、従来と同様に発生する可能性があった。
 近年広く普及しているマルチコアプロセッサを利用した場合、図23のステップS2301~S2304のような設定されていないプロセスを特定のプロセッサに実行させることによって、割り込みを防ぐことができる。ところが、マルチコアプロセッサの場合、1つのプログラムを効率的に実行するため、並列実行可能な処理ブロックはそれぞれ実行対象となるプロセッサに割り当てられる。
 したがって、あるアプリケーションに含まれる処理1がプロセッサ#0によって実行されており、処理1に先行する他の処理の一つが別のプロセッサ(例えば、プロセッサ#1)で実行されている場合がある。そして、プロセッサ#0において、他に実行可能な処理ブロックがない状態になると、プロセッサ#0は、プロセッサ#1で実行されている先行する処理が終了するまで待機しなければならない。
 通常のオペレーティングシステムでは、あるアプリケーションの実行中に実行中のアプリケーションとは無関係な複数のアプリケーションが同時に実行されていることが多い。したがって、オペレーティングシステムでは、上述のプロセッサ#0のように待機時間が発生するとプロセッサ#0の機能を有効に利用するため、他のアプリケーションの処理を行う。
 上述のような場合、アプリケーション単位では、共有するデータを利用する処理が連続して実行されるように見えるが、実際には待機時間の間に別のアプリケーションの処理が実行されており、キャッシュミスが増加するという問題があった。
 また、待機時間に他のアプリケーションを実行しないように設定することも可能であるが、結果として待機時間の間に無条件にプロセッサの動作を停止させることになり、システム全体の性能を低下させてしまうという問題があった。
 本開示技術は、上述した従来技術による問題点を解消するため、待機時間の発生を減少させてキャッシュを効率的に利用できるスケジューラ、マルチコアプロセッサシステムおよびスケジューリング方法を提供することを目的とする。
 上述した課題を解決し、目的を達成するため、本開示技術は、マルチコアプロセッサ内の特定のプロセッサが、後続処理群が共通するスケジューリングの未設定処理群を、対象プログラムを構成する処理群の中から検出し、検出された未設定処理群の未設定処理ごとに、前記未設定処理に対する先行処理群のうち、前記処理群を同一または関連するアクセス対象データを共有するグループに分類したグループ群の中の前記未設定処理の所属グループに属する先行処理を検出し、前記未設定処理ごとに、前記未設定処理を、マルチコアプロセッサの中の検出された先行処理が割り当てられているプロセッサに割り当て、前記未設定処理ごとに、前記未設定処理に対する先行処理群がすべて終了する実行終了時刻から、前記未設定処理の実行時間の経過時刻を算出し、割り当てられた未設定処理ごとに、前記未設定処理の割当先のプロセッサでの実行開始時刻を、算出された最も遅い経過時刻から前記未設定処理の実行時間分さかのぼった時刻に設定する。
 本スケジューラ、マルチコアプロセッサシステムおよびスケジューリング方法によれば、待機時間の発生を減少させてキャッシュを効率的に利用できるという効果を奏する。
本実施の形態にかかるスケジューリング処理の一例を示す説明図である。 マルチコアプロセッサシステムのハードウェア構成の一例を示すブロック図である。 マルチコアプロセッサシステムによるキュー割り付け例を示す説明図である。 依存情報付きプログラムの一例を示す説明図である。 スケジューラの機能的構成の一例を示すブロック図である。 スケジューリング処理の手順を示すフローチャートである。 スケジューリング処理を利用したスケジューリング例を示す説明図である。 実施例におけるプロセッサ割当処理の手順を示すフローチャートである。 実施例におけるスケジューリング処理の手順を示すフローチャートである。 実施例におけるグループ決定処理の手順を示すフローチャートである。 実施例における遅延時間設定処理の手順を示すフローチャートである。 スレッド群その1の構成を示す説明図である。 スレッド群その1についてのキュー割り付け例を示す説明図である。 スケジューリング処理のルート例を示す説明図である。 グループ決定処理のルート例を示す説明図である。 遅延時間設定処理のルート例を示す説明図である。 スレッド群その1の実行結果(プロセッサ4つ)を示す説明図である。 スレッド群その2の構成を示す説明図である。 スレッド群その2についてのキュー割り付け例を示す説明図である。 スレッド群その2の実行結果(プロセッサ4つ)を示す説明図である。 プロセッサ数が少ない場合のスレッド群その1についてのキュー割り付け例を示す説明図である。 プロセッサ数の少ないマルチコアプロセッサにおけるスレッド群その1の実行結果(プロセッサ2つ)を示す説明図である。 従来のプロセスの連続実行を示す説明図である。
 以下に添付図面を参照して、この発明にかかるスケジューラ、マルチコアプロセッサシステムおよびスケジューリング方法の好適な実施の形態を詳細に説明する。
 図1は、本実施の形態にかかるスケジューリング処理の一例を示す説明図である。本実施の形態では、従来の連続実行の間に発生していた待機時間の発生回数を削減することによって、キャッシュミスの低減とプロセッサの処理効率の維持とを両立させる。
 具体的には、下記の3つの処理によってキャッシュミスの低減とプロセッサの処理効率の維持とを両立させている。
(1)実行タイミングを調整して同一プロセッサにおいて前後の処理を連続実行させる。
(2)連続実行に邪魔な処理を特定のプロセッサにまとめて実行させる。
(3)待機時間が発生しても短い時間であれば他のプロセスを実行対象に入れない。
 従来の技術と同様に、本実施の形態は、マルチコアプロセッサによって実行させる対象プログラムに含まれる処理群を、事前に関連するデータを利用する処理ごとのグループに分けている。例えば、処理1~10は、実行時に利用するデータが関連する処理ごとにグループ1~3に分けられている。したがって、図1のように、マルチコアプロセッサシステムを構成するCPU#0~#3の4つのプロセッサのうち、CPU#1には、グループ1に属する処理が割り当てられ、CPU#2にはグループ2に属する処理が割り当て、CPU#3にはグループ3に属する処理が割り当てられている。
 本実施の形態は、さらに、各プロセッサにおいて処理を実行する際のタイミングを、前後の処理同士が連続して実行できるように調整する(上記(1)の処理)。具体的には、本実施の形態では、実行時に利用するデータが共通する処理、すなわち、一旦キャッシュに格納したデータを連続して使用できる処理の実行時間を、設計段階であらかじめ見積もっておく。さらに、本実施の形態では、各処理の実行時間と、各処理ブロックの入出力関係と、データを共有するグループの情報とに基づいて、待機時間の発生回数を極力減らすように処理を実行するタイミングを調整する。
 また、本実施の形態では、外部割り込みや内部割り込みなど連続実行に邪魔な処理を特定のプロセッサにまとめることによって、スケジューラがスケジューリングした順序で各処理が実行される(上記(2)の処理)。例えば、図1の場合、CPU#0は、連続実行に邪魔な処理を実行するための専用のプロセッサとして利用される。プロセッサ#0には、外部および内部の割込処理の他に、いずれのグループにも属していない処理や、グループに関する情報が付与されていない処理が、実行対象の処理として割り当てられる。したがって、プロセッサ#1~#3に割込処理が割り当てられるような事態を防ぎ、プロセッサ#1~#3は、スケジューリング通りのタイミングで指定された処理を実行する。
 また、本実施の形態でも、他のプロセッサによって依存関係のある処理が実行されている場合、処理が終了するまでの間、待機時間が発生することもある。しかしながら、本実施の形態の場合、従来のように待機時間に漏れなく他のアプリケーションのプロセスを実行させるのではなく、待機時間の長さが規定値よりも短いか否かを判断して他のアプリケーションの処理を実行するか否かを判断する。具体的には、プロセッサは、待機時間が短い時間であれば、他のアプリケーションのプロセスを実行させない(上記(3)の処理)。したがって、待機時間が発生しても、各プロセッサが、毎回他のプロセスを実行することはない。結果として、他のプロセスの実行によるキャッシュミスの発生回数が削減される。また、待機時間が長ければ待機時間を利用して他のプロセスを実行するため、プロセッサの処理効率を維持することもできる。
 以上説明したように、本実施の形態にかかるスケジューリング処理を適用することによって、一旦キャッシュに格納したデータを利用する処理を連続して実行させるため、キャッシュミスの回数が削減される。したがって、キャッシュが有効活用され、プロセッサの処理性能を向上させることができる。以下に、本実施の形態にかかるスケジューリング処理を実現するスケジューラの具体的な構成や処理内容について説明する。
(マルチコアプロセッサシステムのハードウェア構成)
 図2は、マルチコアプロセッサシステムのハードウェア構成の一例を示すブロック図である。図2において、マルチコアプロセッサシステム100は、マルチコア201と、ROM(Read‐Only Memory)202と、RAM(Random Access Memory)203と、磁気ディスクドライブ204と、磁気ディスク205と、光ディスクドライブ206と、光ディスク207と、ディスプレイ208と、I/F(Interface)209と、キーボード210と、マウス211と、スキャナ212と、プリンタ213と、を備えている。また、各構成部はバス220によってそれぞれ接続されている。
 ここで、マルチコア201は、n個のCPU(Central Processing Unit)を備え、マルチコアプロセッサシステム100の全体の制御を司る。ROM202は、ブートプログラムや、スケジューリング処理を実現するためのスケジューラなどの各種のプログラムを記憶している。RAM203は、CPU201のワークエリアとして使用される。磁気ディスクドライブ204は、CPU201の制御にしたがって磁気ディスク205に対するデータのリード/ライトを制御する。磁気ディスク205は、磁気ディスクドライブ204の制御で書き込まれたデータを記憶する。
 光ディスクドライブ206は、CPU201の制御にしたがって光ディスク207に対するデータのリード/ライトを制御する。光ディスク207は、光ディスクドライブ206の制御で書き込まれたデータを記憶したり、光ディスク207に記憶されたデータをコンピュータに読み取らせたりする。
 ディスプレイ208は、カーソル、アイコンあるいはツールボックスをはじめ、文書、画像、機能情報などのデータを表示する。このディスプレイ208は、例えば、CRT、TFT液晶ディスプレイ、プラズマディスプレイなどを採用することができる。
 インターフェース(以下、「I/F」と略する。)209は、通信回線を通じてLAN(Local Area Network)、WAN(Wide Area Network)、インターネットなどのネットワーク214に接続され、このネットワーク214を介して他の装置に接続される。そして、I/F209は、ネットワーク214と内部のインターフェースを司り、外部装置からのデータの入出力を制御する。I/F209には、例えばモデムやLANアダプタなどを採用することができる。
 キーボード210は、文字、数字、各種指示などの入力のためのキーを備え、データの入力を行う。また、タッチパネル式の入力パッドやテンキーなどであってもよい。マウス211は、カーソルの移動や範囲選択、あるいはウィンドウの移動やサイズの変更などを行う。ポインティングデバイスとして同様に機能を備えるものであれば、トラックボールやジョイスティックなどであってもよい。
 スキャナ212は、画像を光学的に読み取り、マルチコアプロセッサシステム100内に画像データを取り込む。なお、スキャナ212は、OCR(Optical Character Reader)機能を持たせてもよい。また、プリンタ213は、画像データや文書データを印刷する。プリンタ213には、例えば、レーザプリンタやインクジェットプリンタを採用することができる。
 図3は、マルチコアプロセッサシステムによるキュー割り付け例を示す説明図である。図3のようにマルチコアプロセッサシステム100は、各CPUにスケジューリング処理用の専用プログラムであるスケジューラ200を用意している。そして、マルチコアプロセッサシステム100は、4つのプロセッサの中の特定のプロセッサのスケジューラ200を利用して、対象プログラムを構成する処理群を、各処理を実行させるプロセッサにそれぞれ割り付ける。
 図3では、各CPUに用意されたスケジューラ200のうち、CPU#0のスケジューラ0が、対象プログラムを構成する処理群を各プロセッサに割り付けている。なお、スケジューラ0によるスケジューリング結果(どのプロセッサにおいてどのタイミングで実行するか)は、一旦、プロセッサごとのレディーキューに格納される。
 図3に例示したマルチコアプロセッサシステム100の場合、共有メモリ300に各プロセッサのレディーキューが用意されている。共有メモリ300は、例えば、図2のROM202、RAM203、磁気ディスク205や光ディスク207などを用いて実現される。また、一旦レディーキューに配置された各処理は、各CPUのスケジューラ200によって実行される。
(依存情報付きプログラムのデータ構成)
 図4は、依存情報付きプログラムの一例を示す説明図である。本実施の形態では、プログラムを構成する処理群の各処理に依存情報が付与されている。依存情報のデータ構成に特に限定はないが、情報の内容として、各処理が属するグループ、各処理と依存関係にある先行処理、各処理と依存関係にある後続処理、さらに、各処理の実行時間が含まれている。
 図4では、処理の単位の一例としてスレッド400ごとに付与された依存情報であるスレッド情報401のデータ構成について説明する。スレッド情報401には下記の各情報が含まれている。
 スレッドID:スレッドの識別情報
 先行のスレッドIDリスト:依存関係のある先行スレッドの識別情報
 後続のスレッドIDリスト:依存関係のある後続スレッドの識別情報
 連続実行グループID:キャッシュミスなく連続実行できるグループの識別情報
 推定実行時間:実行に要する時間の推定値
 経過時間:実行時の経過時間(実際の実行状況に応じて変化する)
 上述のようなスレッド情報401を利用することによって、スケジューラ200は、スレッドID0~ID7の実行順序と依存関係とを特定することができる。
(スケジューラの機能的構成)
 図5は、スケジューラの機能的構成の一例を示すブロック図である。スケジューラ200は、第1検出部501と、第2検出部502と、割当部503と、算出部504と、設定部505と、を含む構成である。この制御部となる機能(第1検出部501~設定部505)は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをマルチコア201の中の特定のCPUに実行させることにより、または、I/F209により、その機能を実現する。また、メモリ500は、対象プログラムを格納するため、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置や外部の記憶装置によって実現する。
 第1検出部501は、対象プログラムを構成する処理群の中から特定の条件を満たす処理群を検出する機能を有する。具体的には、第1検出部501は、メモリ500に格納されている対象プログラムの中から、後続処理群が共通するスケジューリングの未設定処理群を検出する。スケジューリングの未設定処理群とは、対象プログラムを構成する処理群のうち、マルチコアプロセッサシステム100によって未実行の処理とスケジューリングによって実行タイミングが設定済の処理とを除いた処理である。
 例えば、ある未設定処理(処理4,5,6)について、処理4の後続処理として処理10,11が設定され、処理5の後続処理として処理10,11が設定され、処理6の後続処理として処理9,12が設定されている場合について説明する。上述のような設定がなされている場合、第1検出部501は、未設定処理群として処理4,5を検出する。なお、検出された未設定処理群は、一旦、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。
 第2検出部502は、第1検出部501によって検出された未設定処理群中から特定の条件を満たす処理群を検出する機能を有する。具体的には、第2検出部502は、未設定処理ごとに、同じグループに属する先行処理を検出する。
 例えば、ある未設定処理(処理5)に着目した場合、依存情報には先行処理として処理1,2,3が設定されている。そして、処理5がグループ1に属している場合、第2検出部502は、処理1,2,3のうち、グループ1に属している処理を検出する。
 また、未設定処理群を構成する未設定処理の内容によっては、グループ1に属している処理が複数含まれている場合もあるが、そのような場合、第2検出部502は、すべての処理を検出する。反対に、未設定処理群にグループ1に属している処理がない場合もある。そのような場合、第2検出部502は、先行処理がないという検出結果を得る。なお、検出結果は、一旦、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。
 割当部503は、未設定処理ごとに、各未設定処理を実行するプロセッサに割り当てる機能を有する。具体的には、割当部503は、未設定処理を、マルチコアプロセッサ201の中の各プロセッサのうち、第2検出部502によって検出された先行処理が割り当てられているプロセッサに割り当てる。
 例えば、ある未設定処理(処理5)の先行処理として、第2検出部502によって同じグループ1に属する処理1が検出されたとする。すると、割当部503は、処理5を処理1と同じプロセッサによって実行させるように割当処理を行う。すなわち、処理1がプロセッサ#2に割り当てられていた場合、割当部503は、処理5をプロセッサ#2に割り当てる。
 また、処理5を対象とした割当処理の際に、既に先行処理となる処理1が終了している可能性もある。したがって、割当部503は、過去の割当処理を参照して処理5を実行させるプロセッサを割り当てる。なお、割当結果は、一旦、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。
 算出部504は、未設定処理ごとに、実際に実行させた場合の処理終了時刻を算出する機能を有する。具体的には、算出部504は、未設定処理に対する先行処理群がすべて終了する実行終了時刻から、未設定処理の実行時間の経過時刻を算出する。
 例えば、ある未設定処理(処理4,5)について処理終了時刻を算出する場合、各未設定処理の処理開始時刻は、先行処理の終了時刻のうち最も遅い時刻になる。そして、処理4の先行処理の終了時刻のうち最も遅い時刻に処理4を開始させた場合に、処理4の実行時間(例えば、図4のスレッド情報401に設定されている推定実行時間)を経過した時刻が、処理4の処理終了時刻となる。同様に、算出部504は、処理5についても処理終了時刻を算出する。なお、算出結果は、一旦、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。
 設定部505は、割当部503によっていずれかのプロセッサに割り当てられた未設定処理ごとに、未設定処理の割当先のプロセッサでの実行開始時刻を設定する機能を有する。具体的には、設定部505は、算出部504によって算出された最も遅い経過時刻から未設定処理の実行時間分さかのぼった時刻を未設定処理の実行開始時刻に設定する。
 例えば、算出部504によって、処理4の処理終了時刻T4と処理5の処理終了時刻T5とが算出されたとする。そしてT4>T5(T4の方がより遅い時刻)の場合、処理4,5は共にT4で終了するように実行開始時刻を設定する。したがって、設定部505は、T4から処理4の実行時間分さかのぼった時刻を処理4の実行開始時刻に設定する。同様に、設定部505は、T4から処理5の実行時間分さかのぼった時刻を処理5の実行開始時刻とする。
 上述の手順によって、T4の時刻には、処理4,5が同時に終了する。そして、第1検出部501の検出の条件に挙げたように、処理4,5は後続処理群が共通している。したがって、後続処理群は、先行処理が同時に終了しているため、T4の時刻に先行処理(ここでは、処理4,5)と連続して実行することができる。
 すなわち、設定部505は、未設定処理の先行処理群がすべて終了する実行終了時刻(例えばT4)が存在する場合には、実行終了時刻T4を、未設定処理の実行開始時刻に設定する。
 以上説明したように、設定部505は、ある未設定処理について、同一のプロセッサで実行される先行処理が終了した後、即座に実行可能となる場合には、未設定処理と先行処理が連続実行されるように上述の未設定処理の実行開始時刻を設定する。反対に、同一のプロセッサで実行される先行処理が終了した後、即座に実行可能ではない場合、設定部505は、未設定処理と後続処理とが連続実行されるように上述の未設定処理の実行開始時刻を設定する。
 以上説明した設定例は、最も基本的な手順であるが、未設定処理群は、先行処理や後続処理の設定、さらに、所属するグループの設定に応じて様々な動作状況が想定される。したがって、以下には、動作状況の違いに応じた、割当部503および設定部505の処理の違いについて説明する。
 まず、第2検出部502が、未設定処理の所属グループに属する先行処理を検出できないような動作状況について説明する。このような動作状況の場合、設定部503は、先行処理が検出されなかった未設定処理を、マルチコア201の中の先行処理が割り当てられていないプロセッサに割り当てる。すなわち、設定部503は、何の処理も割り当てられていない空き状態のプロセッサを割り当てる。
 さらに、第2検出部502では、上述のように未設定処理の所属グループに属する先行処理が検出されず、空きのプロセッサもないような動作状況も想定される。このような動作状況の場合、設定部503は、マルチコア201のうち、割り当て済の先行処理の実行時間が最短となるプロセッサに未設定処理を割り当てる。すなわち、設定部505は、処理負荷の一番軽いプロセッサに未設定処理を割り当てる。
 また、他の例として、未設定処理に実行順序に関する優先度が設定されている場合がある。優先度が設定されている場合、設定部503は、未設定処理のうち、優先度が高く設定されている未設定処理を優先的に、第2検出部502によって検出された先行処理が割り当てられているプロセッサに割り当てる。
 また、他の例として、対象プログラムおよび対象プログラム以外のプログラムによって発生した割込処理が未設定処理となるような動作状況が想定される。このような動作状況の場合、設定部503は、第2検出部502によって未設定処理の所属グループに属する先行処理が検出されなかったプロセッサに割り当てる。
 すなわち、割当部503は、割込処理によって発生した未設定処理を、各グループに属する先行処理が割り当てられているプロセッサとは異なるプロセッサに割り当てる。なお、設定部503は、すべてのプロセッサに各グループに属する先行処理が割り当てられている場合には、マルチコア201のうち、割り当て済の先行処理の実行時間が最短となるプロセッサに、割込処理によって発生した未設定処理を割り当てる。
 割当部503は、スレッド情報401などの後続処理群および先行処理群を特定する情報が含まれていない処理を、第2検出部502によって先行処理が検出されなかったプロセッサに割り当てる。すなわち、設定部503は、先行処理の割り当てられていない、空き状態のプロセッサに、スレッド情報401が付与されていない処理を割り当てる。ここでも、空き状態のプロセッサがない場合、設定部503は、マルチコアプロセッサ201のうち、割り当て済の先行処理の実行時間が最短となるプロセッサに、スレッド情報401が付与されていない処理を割り当てる。
(スケジューリング処理の手順)
 図6は、スケジューリング処理の手順を示すフローチャートである。図6のフローチャートは、スケジューラ200が、実行対象となるアプリケーションに含まれる処理群をマルチコア201の各プロセッサに実行させるタイミングを設定するまでの手順を示している。図6の各処理を実行することによって、スケジューラ200は、実行タイミングが設定されていない未設定処理を依存関係のある先行処理もしくは後続処理と連続して実行できるようなタイミングで各処理を実行させることができる。
 図6において、スケジューラ200は、第1検出部501によって、メモリ500に格納された実行対象となる対象プログラムを構成する処理群の中から、未設定処理群があるか否かを判断する(ステップS601)。ステップS601において、未設定処理群があると判断されるまで待機状態とし(ステップS601:Noのループ)、未設定処理群があると判断されると(ステップS601:Yes)、スケジューラ200は、第1検出部501によって未設定処理を検出する(ステップS602)。
 そして、スケジューラ200は、ステップS602において検出した未設定処理にプロセッサが割り当てられているか否かを判断する(ステップS603)。ステップS603において、未設定処理にプロセッサが割り当てられていないと判断された場合(ステップS603:No)、スケジューラ200は、未設定処理を実行させるプロセッサの割手処理を行う。具体的には、スケジューラ200は、割当部503によって実行中のプロセッサに対する第2検出部502の検出結果に応じて各処理をプロセッサに割り当てる(ステップS604)。
 ステップS603において、未設定処理にプロセッサが割り当てられていると判断された場合(ステップS603:Yes)、割当部603における割当処理は必要ないため、スケジューラ200は、そのままステップS605の処理に移行する。
 次に、スケジューラ200は、未設定処理の先行処理の終了時刻に基づいて、先行処理の終了後に連続実行できるか否かを判断する(ステップS605)。連続実行できるとは、同じプロセッサによって実行されている先行処理が終了した後に、待機時間を挟むことなく未設定処理を実行できる状態を意味する。すなわち、対象となるプロセッサでは、他のプロセッサによって実行されている先行処理が終了している状態である。
 ステップS605において、連続実行できないと判断された場合(ステップS605:No)、スケジューラ200は、未設定処理が後続処理と連続実行できるようにスケジューリングを行う。したがって、スケジューラ200は、まず、第1検出部501によって検出された後続処理が共通する未設定処理について、算出部504によって処理終了時刻を算出する(ステップS606)。
 さらに、スケジューラ200は、ステップS606において算出された処理終了時刻のうち最も遅い処理終了時刻を抽出する(ステップS607)。さらに、スケジューラ200は、ステップS607において抽出された処理終了時刻に各未設定処理が終了するような実行開始時刻を算出する(ステップS608)。
 その後、スケジューラ200は、設定部505によって未設定処理に対して、ステップS608において算出された実行開始時刻に処理を開始するように設定し(ステップS609)、一連の処理を終了する。
 一方、ステップS605において、連続実行できると判断された場合(ステップS605:Yes)、スケジューラ200は、未設定処理が先行処理と連続実行できるようにスケジューリングを行う。したがって、スケジューラ200は、設定部505によって未設定処理に対して、先行処理終了後に待機時間なく連続実行するように設定し(ステップS610)、一連の処理を終了する。
 図7は、スケジューリング処理を利用したスケジューリング例を示す説明図である。図7のスケジューリング例701は、従来のスケジューリング処理を実行した場合を表し、スケジューリング例702は、スケジューラ200のスケジューリング処理を実行した場合を表している。なお、スケジューリング例701,702の場合も、CPU#0ではグループ1に属する処理が実行され、CPU#1ではグループ2に属する処理が実行され、CPU#2ではグループ3に属する処理が実行される。
 スケジューリング例701が表す従来のスケジューリング処理の場合、他のプロセッサによって実行されている先行処理の終了時刻のうち最も遅い時刻(t1~t4)に到達するまで、各処理には毎回待機時間が発生していた。
 一方、スケジューリング例702が表すスケジューラ200のスケジューリング処理の場合、各処理は、少なくとも、先行処理、もしくは、後続処理のいずれかと連続実行するようにスケジューリングされている。したがって、同じ数の処理を実行する場合であっても、待機時間の発生回数が大幅に削減される。
 さらに、待機時間が発生した場合であっても、待機時間が規定値よりも短ければ、待機時間に他のアプリケーションの処理を実行するようなスケジューリングが行われることもない。したがって、各プロセッサは、一旦キャッシュに格納されたデータを長く利用するため、それぞれ処理効率を上げることができる。
(実施例)
 次に、スケジューラ200の具体的な実施例について説明する。本実施例では、処理の単位としてスレッドを実装する。スレッドとはオペレーティングシステムにおける最小の処理の管理単位である。通常、スレッドにはオペレーティングシステムが管理するための管理情報として、スレッドの識別情報や、起動時刻、稼働時間、優先順位といった情報が付与されている。
 本実施例では、スレッド情報として、上述のような通常の管理情報に加えて、先行するスレッドとなる先行スレッドについての識別情報のリストと、後続のスレッドとなる後続スレッドについての識別情報のリストと、グループの識別情報と、スレッドの実行時間(例えば、予想処理時間)が付与されている。
 ここで、先行スレッドとはスレッド同士の入出力関係で、このスレッドの入力となるデータを生成するスレッドであり、先行するスレッドがすべて終了すると、対象となるスレッドが実行可能になる。後続スレッドは逆にこのスレッドが生成するデータを入力とするスレッドとなる。
 また、グループの識別情報は、対象プログラムを解析することによって特定された、関連データを共有するスレッドの集団を示す情報である。グループの識別情報が同じスレッドを同一のプロセッサで連続して実行することで、所定のデータが格納されたキャッシュを利用し続けることができるため、キャッシュミスを起こすことなく、キャッシュの利用効率を上げることができる。
 また、スレッドの実行時間については、対象プログラムの解析結果を利用して設定してもよく、事前にスレッドを実行してその時の処理時間とキャッシュのミス率、スケジューラ200を適用することで期待できるキャッシュのミス率から求めることができる。したがって、以降の本実施例の説明では、スレッドの実行時間を「予想処理時間」と呼ぶ。
 そして、本実施例では、マルチコアプロセッサシステム100によって実行するアプリケーション毎にスケジューラ200によるスケジューリング処理を適用するが、本手法が適用されていないアプリケーションでは、スレッド情報401が付与されていない従来通りのスレッドにより構成されるものとする。
 一方で、スケジューラ200によるスケジューリング処理を適用したアプリケーションは、複数のスレッドで構成されているものとする。さらに、複数のスレッドのうちの幾つか、もしくは、すべてのスレッドは、先行スレッドのリストと後続スレッドのリストのいずれか、もしくは、両方と予想処理時間の情報と、所属するグループの識別情報を持つものとする。
 以降、先行のスレッドのリストと後続のスレッドのリストのいずれかもしくは両方と予想処理時間の情報を持つスレッドを「依存情報を持つスレッド」とし、従来のスレッドを「依存情報を持たないスレッド」とする。また、グループの識別情報を持つスレッドをグループに属するスレッド、同一のグループ識別情報を持つスレッドを同一のグループに属するスレッドとする。
 通常、マルチコアプロセッサシステム100を起動させると、オペレーティングシステムが動作してアプリケーションを起動する。さらにオペレーティングシステムは、アプリケーション内でメインとなるスレッドを起動させる。起動の際に、複数スレッドがある場合はメインとなるスレッドからスレッドを起動させる。そして、起動させたメインとなるスレッドからさらに、他のスレッドを起動といった形で順次スレッドが起動される。また、アプリケーション内に依存情報が付与されたスレッドがある場合、依存情報が付与されていないいずれかのスレッドから一括して依存情報を持つスレッドが起動される。
 オペレーティングシステムは、新たにスレッドが起動されると、スレッドの割当先プロセッサを決定してそのプロセッサに対応するレディーキューという実行可能なスレッド群を格納する共有メモリ300内のデータ構造にスレッドを追加する。
 依存情報を持つスレッドが新たに起動された場合、スケジューラ200は、以下の図8に示した割当処理によって同一のグループに属するスレッドを同一のプロセッサに割り当てる。また、割当処理では、同一のグループに属するスレッドを同一のプロセッサに割り当てるのみならず、各プロセッサでの処理量がなるべく均一になるようにスレッドの割当先を決定することができる。
(プロセッサの割当処理)
 図8は、実施例におけるプロセッサの割当処理の手順を示すフローチャートである。図8のフローチャートは、スケジューラ200が、マルチコアプロセッサによってアプリケーションを構成するスレッドを各プロセッサに割り当てるまでの手順を示している。図8の各処理を実行することによって、グループ情報が共通するスレッドを同一のプロセッサによって実行されるように割り当てることができる。
 さらに、実施例では、各グループの実行に要する時間を参照して、処理時間の長いグループに含まれるスレッドから順番に割り付けるため、効率的に各スレッドが実行できるような割り当てが可能となる。
 図8において、スケジューラ200は、まず、グループ毎に予想処理時間の合計を算出する(ステップS801)。続いて、スケジューラ200は、未割り当てのグループがあるか否かを判断する(ステップS802)。
 ステップS802において、未割り当てのグループがあると判断された場合(ステップS802:Yes)、スケジューラ200は、割り当てられたスレッドの予想処理時間の合計が最小のプロセッサを選択する(ステップS803)。その後、スケジューラ200は、予想処理時間の合計が最大のグループの全スレッドをステップS803において選択したプロセッサに割り当てる(ステップS804)。
 以上説明したステップS802~S804では、未割り当てのグループに対して実際の処理を実行させるためのプロセッサを割り当てるための処理を行っている。ステップS802によって未割り当てのグループがないと判断されると、次に説明するスレッドを対象として、各プロセッサに割り当てを行うための処理に移行する。
 ステップS802において、未割り当てのグループがないと判断された場合(ステップS802:No)、スケジューラ200は、未割り当てのスレッドがあるか否かを判断する(ステップS805)。すなわち、スケジューラ200は、ステップS805によって、各プロセッサに割り付けられたグループに属する各スレッドについての実行対象となるプロセッサの割り当てが可能か否かの判断を行っている。
 ステップS805において、未割り当てのスレッドがあると判断されると(ステップS805:Yes)、スケジューラ200は、各プロセッサの中から、割り当てられたスレッドの予想処理時間の合計が最小のプロセッサを選択する(ステップS806)。
 さらに、スケジューラ200は、未割り当てのスレッドの中で予想処理時間が最大のスレッドを、ステップS806によって選択されたプロセッサに割り当てる(ステップS807)。その後、スケジューラ200は、ステップS805によって未割り当てのスレッドがあると判断されると、ステップS806,S807の処理を繰り返し、未割り当てのスレッドがないと判断されると(ステップS805:No)、一連の割当処理を終了する。
 以上説明した割当処理の後、スレッドが新たにレディーキューに追加されるか、スレッドの終了などによりスレッドがレディーキューから削除されると、オペレーティングシステムではスケジューラ200によってスレッドのスケジューリング処理を実行させる。
 従来のスケジューリングにおいて、スケジューラ200は、スレッドの優先順位を見て行うが、本実施例の場合、同一グループに属するスレッドをなるべく連続して実行させるため、後述する図9のスケジューリング処理を行う。なお、各プロセッサにおけるスケジューリング処理はレディーキュー毎に対応するスケジューラ200によって行われる。
 また、各プロセッサには、現在実行しているグループの識別情報を格納するデータ構造(実行グループ情報)と、現在実行中のスレッドが時間調整をしたかを示すフラグ(no_waitフラグ)とがレディーキューに設定されている。
<スケジューリング処理の手順>
 図9は、実施例におけるスケジューリング処理の手順を示すフローチャートである。図9のフローチャートは、スケジューラ200による各プロセッサに割り当てられたスレッドの実行タイミングの設定手順を示している。図9の各処理を実行することによって、スレッド間の待機時間の発生を軽減させることができる。
 図9において、スケジューラ200は、まず、各プロセッサによって実行中のスレッドについてのグループ情報が設定されているか否かを判断する(ステップS901)。ステップS901において、グループ情報が設定されていないと判断された場合(ステップS901:No)、スケジューラ200は、レディーキューから最高優先度のスレッドを選択する(ステップS902)。そして、スケジューラ200は、ステップS902による選択スレッドに依存情報がなく、グループに属するスレッドよりも優先度が高いか否かを判断する(ステップS903)。
 ステップS903において、選択スレッドに依存情報がなく、グループに属するスレッドよりも優先度が高いと判断された場合(ステップS903:Yes)、スケジューラ200は、選択スレッドを実行させて(ステップS904)、スケジューリングを終了する。一方、ステップS903において、選択スレッドに依存情報がある、または優先度が高くないと判断された場合(ステップS903:No)、スケジューラ200は、グループ内に実行可能なスレッドがあるか否かを判断する(ステップS905)。
 ステップS905において、グループ内に実行可能なスレッドがあると判断された場合(ステップS905:Yes)、スケジューラ200は、実行可能なスレッドにno_waitフラグが設定されているか否かを判断する(ステップS906)。
 ステップS906において、no_waitフラグが設定されていると判断された場合(ステップS906:Yes)、スケジューラ200は、no_waitフラグを解除する(ステップS907)。そして、スケジューラ200は、グループ内の実行可能なスレッドのうち、最も予想処理時間の大きなスレッドを選択して実行させ(ステップS908)、スケジューリングを終了する。
 ステップS906において、no_waitフラグが設定されていないと判断された場合(ステップS906:No)、スケジューラ200は、遅延時間処理を行って(ステップS909)、遅延起動されるように設定した後、ステップS915の処理に移行する。
 一方、ステップS905において、グループ内に実行可能なスレッドがないと判断された場合(ステップS905:No)、スケジューラ200は、遅延起動が設定されているスレッドがあるか否かを判断する(ステップS910)。ステップS910において、遅延起動が設定されているスレッドがあると判断された場合(ステップS910:Yes)、スケジューラ200は、ステップS915の処理に移行する。
 一方、ステップS910において、遅延起動が設定されているスレッドがないと判断された場合(ステップS910:No)、スケジューラ200は、さらに、スレッドにno_waitフラグが設定されているか否かを判断する(ステップS911)。ステップS911において、no_waitフラグが設定されていると判断された場合(ステップS911:Yes)、スケジューラ200は、Idleスレッドを実行させ(ステップS912)、一連の処理を終了する。
 ステップS911において、no_waitフラグが設定されていないと判断された場合(ステップS911:No)、スケジューラ200は、グループ決定処理(ステップS913)と、遅延時間設定処理を行い(ステップS914)、ステップS915の処理に移行する。
 遅延時間設定処理を行った、もしくは、ステップS910において、遅延起動が設定されているスレッドがあると判断された場合、スケジューラ200は、遅延起動までの最小の時間が規定値以下か否かを判断する(ステップS915)。ステップS915において、スケジューラ200は、遅延起動までの待機時間に他のアプリケーションを構成するスレッドを実行するか否かを判断している。
 ステップS915において、最小の時間が規定値以下であると判断された場合(ステップS915:Yes)、スケジューラ200は、Idleスレッドを実行させて(ステップS916)、一連の処理を終了する。一方、ステップS915において、最小の時間が規定値以下ではないと判断された場合(ステップS915:No)、スケジューラ200は、レディーキューから依存情報のない最高優先度のスレッドを選択して実行させ(ステップS917)、一連の処理を終了する。
 次に、ステップS913のグループ決定処理と、ステップS909およびS914の遅延時間設定処理との詳細な手順について説明する。
<グループ決定処理の手順>
 図10は、実施例におけるグループ決定処理の手順を示すフローチャートである。図10のフローチャートは、図9にて説明したスケジューリング処理のステップS913の詳細な処理内容を示している。図10の各処理を実行することによって、グループが決定されていない処理のグループを決定することができる。
 図10において、スケジューラ200は、まず、レディーキュー内の依存情報付きのスレッドをすべて選択する(ステップS1001)。その後、スケジューラ200は、ステップS1001においてなんらかのスレッドが選択されたか否かを判断する(ステップS1002)。
 ステップS1002において、スレッドが選択されなかった場合(ステップS1002:No)、スケジューラ200は、当プロセッサによって実行中のグループ情報を削除する(ステップS1003)。さらに、スケジューラ200は、レディーキューから優先順位が最も高いスレッドを選択して実行させ(ステップS1004)、一連の処理を終了する。
 一方、ステップS1002において、スレッドが選択された場合(ステップS1002:Yes)、スケジューラ200は、選択されたスレッドの依存関係を解析して実行可能なスレッドをすべて選択する(ステップS1005)。そして、スケジューラ200は、ステップS1005において、なんらかのスレッドが選択されたか否かを判断する(ステップS1006)。
 ステップS1006において、スレッドが選択されなかった場合(ステップS1006:No)、スケジューラ200は、レディーキューから依存情報のない最高優先度のスレッドを選択して実行させ(ステップS1007)、一連の処理を終了する。
 一方、ステップS1006において、スレッドが選択された場合(ステップS1006:Yes)、スケジューラ200は、さらに、選択されたスレッドの中にグループに属するスレッドがあるか否かを判断する(ステップS1008)。
 ステップS1008において、グループに属するスレッドがあると判断された場合(ステップS1008:Yes)、スケジューラ200は、ステップS1005において選択されたスレッドから予想処理時間の最も大きなスレッドを選択して実行させ(ステップS1009)、一連の処理を終了する。
 ステップS1008において、グループに属するスレッドがないと判断された場合(ステップS1008:No)、スケジューラ200は、ステップS1005において選択されたスレッド内のスレッドが属するグループをすべて選択する(ステップS1010)。さらに、スケジューラ200は、ステップS1010において選択されたグループ毎の予想処理時間の合計を計算する(ステップS1011)。その後、スケジューラ200は、ステップS1011において計算された予想処理時間の合計が最大のグループを実行中のグループとして選択して(ステップS1012)、一連の処理を終了する。
<遅延時間設定処理の手順>
 図11は、実施例における遅延時間設定処理の手順を示すフローチャートである。図11のフローチャートは、図9のステップS909,S914の遅延時間設定処理の詳細な手順を示している。図11の各処理を実行することによって、先行するスレッドの直後に実行可能とならないスレッドに対して、スレッドの終了後に即座に後続のスレッドを実行可能となるように実行開始時刻を調整するための適切な遅延時間を設定することができる。
 図11において、スケジューラ200は、現在プロセッサにおいて実行中の処理が属するグループから実行可能なスレッドを選択する(ステップS1101)。その後、スケジューラ200は、ステップS1101において選択したスレッドの同グループの全後続スレッドを対象となるレディーキューから選択する(ステップS1102)。
 さらに、スケジューラ200は、ステップS1102の条件に沿ったスレッドが選択されたか否かを判断する(ステップS1103)。ステップS1103において、スレッドが選択されなかった場合(ステップS1103:No)、スケジューラ200は、遅延時間を設定する必要はない。したがって、スケジューラ200は、ステップS1101において選択された実行可能なスレッドを実行させて(ステップS1104)、一連の処理を終了する。
 一方、ステップS1103において、スレッドが選択された場合(ステップS1103:Yes)、スケジューラ200は、ステップS1102において選択されたスレッド群の全先行スレッドを全レディーキューから選択する(ステップS1105)。さらに、スケジューラ200は、ステップS1105において選択されたスレッドの中から未実行のスレッドをすべて選択する(ステップS1106)。
 その後、スケジューラ200は、選択スレッド内に実行可能スレッドのみが存在するか否かを判断する(ステップS1107)。ステップS1107において、実行可能スレッドのみが存在すると判断された場合(ステップS1107:Yes)、スケジューラ200は、ステップS1105において選択されたスレッドの中から残りの処理時間が最大のスレッドを選択する(ステップS1108)。
 さらに、スケジューラ200は、ステップS1108において選択されたスレッドの処理時間からステップS1101において選択された実行可能なスレッドの予想処理時間を引いた時間を算出する(ステップS1109)。そして、スケジューラ200は、ステップS1109によって算出された算出時間が0よりも大きい値か否かを判断する(ステップS1110)。
 ステップS1110において、算出時間がよりも大きい値と判断された場合(ステップS1110:Yes)、スケジューラ200は、待機時間の設定処理に移行する。したがって、スケジューラ200は、ステップS1101によって選択された実行可能なスレッドをステップS1109の算出時間だけスリープするように設定し(ステップS1111)、一連の処理を終了する。
 一方、ステップS1110において、算出時間が0よりも大きい値ではないと判断された場合(ステップS1110:No)、スケジューラ200は、待機時間を設定する必要がないため、no_waitフラグをtrueに設定する(ステップS1112)。その後、スケジューラ200は、ステップS1101において選択された実行可能なスレッドを実行させて(ステップS1113)、一連の処理を終了する。
 また、ステップS1107において、実行可能スレッドのみが存在しないと判断された場合(ステップS1107:No)、スケジューラ200は、処理対象を他のグループのスレッドに移行する。したがって、スケジューラ200は、ステップS1106において選択されたスレッド内に当プロセッサに割り当てられた別グループのスレッドがあるか否かを判断する(ステップS1114)。
 ステップS1114において、別グループのスレッドがあると判断された場合(ステップS1114:Yes)、スケジューラ200は、ステップS1101によって選択された実行可能なスレッドを実行させて(ステップS1104)、一連の処理を終了する。
 一方、ステップS1114において、別グループのスレッドがないと判断された場合(ステップS1114:No)、スケジューラ200は、ステップS1106において選択されたスレッドの中から、予想処理時間が最大のスレッドを選択する(ステップS1115)。その後、スケジューラ200は、ステップS1115において選択されたスレッド数がステップS1101において選択された実行可能なスレッド数と等しいか否かを判断する(ステップS1116)。
 ステップS1116において各スレッド数が等しいと判断された場合(ステップS1116:Yes)、スケジューラ200は、ステップS1108の処理に移行する。一方、ステップS1116において、各スレッド数が等しくないと判断された場合(ステップS1116:No)、スケジューラ200は、ステップS1115において選択されたスレッドの実行開始をステップS1101において選択された実行可能なスレッドの実行可能条件に設定し(ステップS1117)、一連の処理を終了する。
 本実施例では、上述したようなスケジューリング処理を行うことによって、マルチコアプロセッサシステム100において、効率的にアプリケーションを実行させることができる。以下には、本実施例にて説明したマルチコアプロセッサシステム100によって各種アプリケーションを実行させた場合の具体的な動作例について説明する。
<実行例1>
 実行例1では、まず、典型的なアプリケーションの例として、依存情報を持った10個のスレッド群(後述するスレッド群その1)を起動した場合の実行内容について説明する。なお、実行例1を実行するマルチコアプロセッサシステム100の場合、プロセッサ#0~#3の4つのコアを備えている。そして、マルチコアプロセッサシステム100に実行させるスレッド群その1は、グループ1~4の4つのグループに分けられている。したがって、スケジューラ200は、各プロセッサにそれぞれ異なるグループのスレッドを割り当てることができる。
 図12は、スレッド群その1の構成を示す説明図である。図12に例示したように、スレッド群その1は、ID1~ID10の10個のスレッドを含んでいる。各スレッドには、スレッドを識別するIDの他に、依存情報として下記の情報が付与されている。
 先行:依存関係のある先行スレッドのIDを表す情報
 後続:依存関係のある後続スレッドのIDを表す情報
 グループ:スレッド実行時に対象となるデータが共通するグループ同士を表す情報
 予想時間:スレッドの実行に要する時間として予想された時間を表す情報
 図13は、スレッド群その1についてのキュー割り付け例を示す説明図である。スレッド群その1は、図8にて説明した割当処理を行った場合、図13のように、各プロセッサのレディーキューに配置される。具体的には、プロセッサ#0には、スレッドID1,2,6が割り当てられる。また、プロセッサ#1には、スレッドID3,7,10が割り当てられる。さらに、プロセッサ#2には、スレッドID4,8が割り当てられる。そして、プロセッサ#3には、スレッドID5,9が割り当てられる。
 ここで、図14は、スケジューリング処理のルート例を示す説明図であり、図15は、グループ決定処理のルート例を示す説明図であり、図16は、遅延時間設定処理のルート例を示す説明図である。以下の実行例の説明には、図14~16に示した各処理の実行手順を示すルートを挙げて具体的な実行内容について説明する。
 スレッド群その1が各プロセッサに割り当てられると、各スケジューラ200は、各スレッドの依存情報を参照して実行タイミングを設定する。スレッド群その1の場合、まず、プロセッサ#0では、図14に示したルート1-1と、図15に示したルート2-1を経ることによって、先行スレッドのないスレッドID1が実行される。
 スレッドID1が実行されている間、プロセッサ#1~3では依存関係のあるスレッドの中に実行可能なスレッドがないため、スケジューラ200は、図14のルート1-1と図15ルート2-2を経る。したがって、プロセッサ#1~3では、各レディーキュー内の別のアプリケーションソフトウェアのスレッドが実行される。
 プロセッサ#0において、スレッドID1の実行が終了した後、従来のスケジューラでは、プロセッサ#0のみでスケジューリングが行われていた。しかしながら、本実行例の場合、スケジューラ200によって、依存関係の付いたスレッド終了時に後続のスレッドを保持するレディーキューが検索される。さらに、スケジューラ200は、レディーキューに関連づけられたプロセッサでもスケジューリングを行うようにプロセッサ#0から他のプロセッサ(プロセッサ#1~3)にスケジューリング要求を通知する。
 プロセッサ#0ではスレッドID1の終了により、スレッドID2が実行可能になる。しかしながら、スレッドID1が終了した時点ではまだ実行中グループが設定されていない。したがって、スケジューラ200は、図14のルート1-1と図15のルート2-3を経て、プロセッサ#0において、グループ1を実行中グループに決定する。
 さらに、プロセッサ#0には、スレッドID2の後続スレッドでかつ同一のグループに属するスレッドID6が同じプロセッサに割り当てられている。したがって、スケジューラ200は、図16のルート3-1を経る。したがって、スレッドID6の先行スレッドのうち、まだ実行が開始されていないスレッドの実行時間が比較される。
 スレッド群その1を実行した場合、スレッドID1が終了したことにより、スレッドID1の後続スレッドとなるスレッドID2~5についてのスケジューリングは各プロセッサにおいて、ほぼ同時に実行される。したがって、上述のルート3-1が実行された瞬間は、スレッドID1が終了したことにより実行可能となるスレッドID2~5のいずれも実行が開始されていないとすると、未実行で処理時間が最大のスレッドはスレッドID3となる。そこで、スケジューラ200は、図16のルート3-2を経てスレッドID3の実行開始をスレッドID2の実行可能条件に設定する。
 プロセッサ#1のスケジューラ200は、図14のルート1-1と、図15のルート2-3と、図16のルート3-1を経る。そして、実行可能なスレッドID3が、同グループに属する後続のスレッド7の先行スレッドのうち最も予想処理時間が大きい。そこで、スケジューラ200は、図16のルート3-3を経て、スレッドID3が実行されるようにスケジューリングする。
 プロセッサ#3のスケジューラ200は、スレッドID3の開始前であれば、プロセッサ#0と同様に、スレッドID3の実行開始を、スレッドID5の実行可能条件に設定する。一方、プロセッサ#3のスケジューラ200は、スレッドID3の開始後であれば、図16のルート3-4を経て遅延起動を設定する。
 スケジューラ200によって起動遅延時間が設定されると、各プロセッサは、従来のスケジューリング技術を利用してスレッドの遅延起動を調整することができる。例えば、既存のオペレーティングシステムが提供しているusleepなどの機能を利用すれば容易に遅延起動を実現することができる。したがって、遅延起動の実現についての具体的な手法の説明については省略するが、遅延起動が設定されたスレッドはスリープ中として一旦レディーキューから外され、遅延時間経過後にレディーキューに戻される。
 プロセッサ#2のスケジューラ200は、スケジューリング処理を行うタイミングにより実行内容が異なる。具体的には、スケジューラ200は、スケジューリング処理時に、スレッドID3が未実行なら図16のルート3-2を経てスレッドID4の実行可能条件にスレッドID3の実行開始を設定する。また、スケジューラ200は、スケジューリング処理時に、スレッドID3が実行中で、スレッドID5が未実行なら同じく図16のルート3-2を経ても、スレッドID5の実行開始をスレッドID4の実行可能条件とする。
 さらに、スケジューラ200のスケジューリング処理時に、スレッドID5がスリープ中の場合、スリープ中のスレッドはレディーキューには存在しない。したがって、スレッドID4がレディーキュー内の未実行のスレッドのうち予想処理時間が最大となるため、スケジューラ200は、図16のルート3-3とルート3-4を経て、遅延時間を設定する。すなわち、スレッドID4は遅延時間分スリープさせられる。
 その後、スレッドID3の実行が開始されると、スレッドID3の開始を実行可能条件に設定されていた各スレッドが再度実行可能になる。したがって、スケジューラ200は、今度は、既にグループが決まっているため図14のルート1-2を経て、遅延時間設定処理を行う。遅延時間設定処理において、スケジューラ200は、図16のルート3-1~3-4を経る。また、スケジューラ200は、未実行のスレッドが減ってきた場合は図16のルート3-5を経て、対象となるスレッドを実行するか、スリープするか、再度別のスレッドの実行開始を実行可能条件に設定して待つかのいずれかの処理を行う。
 プロセッサ#0において、スレッドID2の実行が終了すると、スケジューラ200は、再度スケジューリングを行う。このとき、対象となるスレッドのno_waitフラグがtrueであるため、同グループで実行可能なスレッドがあればスケジューラ200は、図14のルート1-3を経て、対象となるスレッドを即座に実行させる。また、no_waitフラグがtrueでなくても、近いうちに他の先行スレッドが終了するため、スケジューラ200は、図14のルート1-4を経てキャッシュを乱さないようにIdleスレッドを実行させて、先行スレッドが終了するのを待つ。以上説明した処理は、プロセッサ#1~3のスケジューラ200においても同様に実行される。
 スレッドID6~9のスケジューリング処理が終了すると、スケジューラ200では、最後にスレッドID10を対象スレッドとしたスケジューリング処理が開始される。スレッドID10は、いずれのグループにも属さないため、先行スレッドがすべて終了すると、スケジューラ200では、終了タイミングで最早グループに属する未実行のスレッドは存在しないと判断される。そこで、スケジューラ200は、図14のルート1-5と図15のルート2-1を経て、スレッドID10を実行させる。
 その後、スレッドID10が割り当てられたプロセッサ#1のスケジューラ200は、スレッドID10が終了すると、他に依存情報が設定されたスレッドが存在しないため、図14のルート1-5と図15のルート2-4を経て、実行中のグループ情報を削除する。同様に、他のプロセッサのスケジューラ200でも、それぞれ、スレッドID6,8,9が終了すると、図14のルート1-5と図15のルート2-4を経て、実行中グループ情報を削除する。
 また、スケジューラ200は、対象となるスレッドがスリープ中の場合は、依存情報が設定されていないスレッドを実行させる。そして、実行されたスレッドが終了してもまだ対象となるスレッドがスリープ中の場合、スケジューラ200は、図14のルート1-6を通って別のスレッドの実行を試みる。また、依存情報の付いたアプリケーションソフトウェア実行中に、割り込みや別のアプリケーションソフトウェアなどにより優先度の高いスレッドが実行されてしまった場合、スケジューラ200は、図14のルート1-7を経て、スケジューリングを行う。
 図17は、スレッド群その1の実行結果(プロセッサ4つ)を示す説明図である。実行例1のように、スレッド群その1を、プロセッサを4つ備えたマルチコアプロセッサシステム100に実行させると、図17に例示したような順序のスケジューリングが行われる。
 スレッドID8の後続スレッドであるスレッドID10は、実行可能になった時刻には先行処理であるスレッドID6~9が終了している。したがって、スレッドID10は、同じプロセッサの先行処理であるスレッドID8が終了した後、即座に実行される。
 スレッドID1の後続スレッドであるスレッドID2~5は、予即処理時間が最長のスレッドID3の実行終了時刻を基準にしてスレッドID2,4,5の実行開始時刻がスケジューリングされる。結果として、スレッドID2~5は同時刻に終了するため、各スレッドの後続スレッドであるスレッドID6~9は、スケジューラ200によって、待機時間を挟むことなく、連続して実行するようにスケジューリングされる。
<実行例2>
 実行例2では、実行例1において実行したスレッド群その1よりも複雑な構成のスレッド群その2(図18参照)についての実行例について説明する。実行例2も、実行例1と同様に、プロセッサ#0~#3の4つのコアを備えたマルチコアプロセッサシステム100を利用するが、実行対象となるスレッド群その2は、依存情報を持った18個のスレッド群である。
 図18は、スレッド群その2の構成を示す説明図である。図18に例示したように、スレッド群その2は、ID1~18の18個のスレッドを含んでいる。各スレッドには、スレッド群その1と同様に、スレッドを識別するIDの他に依存情報が付与されている。
 図19は、スレッド群その2についてのキュー割り付け例を示す説明図である。スレッド群その2について、図8にて説明した割当処理を行った場合、図19のように、各プロセッサのレディーキューに配置される。具体的には、プロセッサ#0には、スレッドID1,2,6,10,14が割り当てられる。また、プロセッサ#1には、スレッドID3,7,11,15,18が割り当てられる。さらに、プロセッサ#2には、スレッドID4,8,12,16が割り当てられる。そして、プロセッサ#3には、スレッドID5,9,13,17が割り当てられる。
 実行例2についても、図14~16に示した各処理の実行手順を示すルートを挙げて具体的な実行内容について説明する。実行例2の場合もスレッドID1~9までは、実行例1と同様の手順を経てスケジューリングされる。したがって、スレッドID10以降のスケジューリングについて説明する。
 まず、スレッドID10~13は、先行するスレッドの中で最も予想処理時間の大きなスレッドID8が終了したタイミングで実行可能となる。このとき、スレッドID10,11,13について、スケジューラ200は、スレッドID2~5と同じ手順を経て、実行タイミングを設定する。一方で、スレッドID12については、同プロセッサで直前に行っていた同グループの処理の終了により実行可能となる。したがって、スケジューラ200は、図14のルート1-7を経ることによって、時間調整することなく、スレッドID12を即座に実行させることができる。
 上述のようなスケジューリングの結果、スレッドID14,15,17は、no_waitフラグが設定されるため、スケジューラ200によって即座に実行される。スレッドID16は、no_waitフラグが設定されないため本来なら時間調整対象だが、スレッド群その2を実行させた場合、後続スレッドに、同グループに属するスレッドがない。したがって、スケジューラ200は、図14のルート1-5と図15のルート2-3と図16のルート3-6を経て、スレッドID16を即座に実行するようにスケジューリングする。
 仮に、スレッドID16の後続スレッドとして同じグループに属するスレッドが用意されている場合であれば、スケジューラ200は、スレッドID16を処理時間の大きなスレッドID17の終了時刻に合わせて終了するように、実行開始時刻を調整する。今度はスレッドID16の後続スレッドのみno_waitフラグが設定されるため、スレッドID16は、即座に実行されることになる。
 図20は、スレッド群その2の実行結果(プロセッサ4つ)を示す説明図である。実行例2のように、スレッド群その2を、プロセッサを4つ備えたマルチコアプロセッサシステム100に実行させると、図20に例示したような順序のスケジューリングが行われる。
 スレッドID1~9は、実行例1と同じタイミングで実行されるようにスケジューリングされる。その他の後続スレッドは、スレッドID13の実行終了時刻を基準にしてスレッドID10,11,13の実行開始時刻がスケジューリングされる。結果として、スレッドID10,11,13は同時刻に終了するため(スレッドID12については既に終了済)、各スレッドの後続スレッドであるスレッドID14~17は、スケジューラ200によって、待機時間を挟むことなく、連続して実行するようにスケジューリングされる。
<実行例3>
 実行例3では、1つのプロセッサに複数のグループのスレッドが割り当てられる場合の実行例について説明する。実行例1,2では、一つのプロセッサに一つのグループに属するスレッドが割り当てられた場合を説明したが、実行例3では、プロセッサ数がグループ数より少なく、一つのプロセッサに複数のグループが割り当てられた場合について説明する。具体的には、図8のような依存関係を持ったスレッドを二つのプロセッサで実行する場合について説明する。
 図21は、プロセッサ数が少ない場合のスレッド群その1についてのキュー割り付け例を示す説明図である。実行例3の場合、マルチコアプロセッサシステム2100が、図8の割当処理を実行することによって、図21のように、グループ1とグループ3に属する各スレッドがプロセッサ#0に、グループ2とグループ4に属する各スレッドがプロセッサ#1に割り当てられる。
 実行例3の場合、スレッドID1は、実行例1,2と同様に、先行処理としてプロセッサ#0によって実行されるようにスケジューリングされる。スレッドID1が終了すると、プロセッサ#0ではグループ1に属するスレッドID2とグループ3に属するスレッドID4の2つのスレッドが実行可能となる。
 したがって、スケジューラ200は、まずプロセッサ#0によって実行するグループを選択する。具体的には、スケジューラ200は、図14のルート1-1と図15のルート2-3を経て、総実行時間の大きなグループ3を選択する。そこで、スケジューラ200は、グループ3内の実行可能なスレッドID4の遅延時間を設定する。
 しなしながら、スレッドID4の同グループの後続となるスレッドID8の先行スレッドのうち、スレッドID2がスレッドID4と同じプロセッサに割り当てられている。したがって、スケジューラ200は、スレッドID4とスレッドID8はどうやっても連続に実行することはできない。そこで、スケジューラ200は、スレッドID4は図16のルート3-7を経て、遅延させずに、即座に実行させるように設定する。
 スレッドID4が終了するとグループ内に実行可能なスレッドが無くなるため、スケジューラ200は、図14のルート1-5と図15のルート2-3とを経て、実行中グループがグループ1に変わった後、スレッドID2に遅延起動を設定する。なお、スレッドID2の同グループでの後続スレッドとなるスレッドID6の先行スレッドのうち、スレッドID3が未実行のスレッドの中で最大の予想処理時間となる。したがって、スケジューラ200は、スレッドID2の実行可能条件をスレッドID3の実行開始に変更する。
 さらに、スレッドID3は、スレッドID5終了時に実行を開始される。したがって、スケジューラ200は、再度、スレッドID2が実行可能となるため、スレッドID3の予想処理時間-スレッドID2の予想処理時間(減算処理の結果)を遅延時間に設定する。
 また、スレッドID6,7は、no_waitフラグが設定されている。したがって、スケジューラ200は、上述の各スレッドを即座に実行させることができる。さらに、スケジューラ200は、スレッドID8,9が、後続スレッドとなるスレッドID10と同一グループに属さないため、スレッドID6,7終了後すぐに、スレッドID8,9をそれぞれ実行させることができる。
 図22は、プロセッサ数の少ないマルチコアプロセッサにおけるスレッド群その1の実行結果(プロセッサ2つ)を示す説明図である。実行例3のように、スレッド群その1を、プロセッサを2つ備えたマルチコアプロセッサシステム2100に実行させると、図22に例示したような順序のスケジューリングが行われる。実行例3のように、1つのプロセッサに複数のグループのスレッドが割り当てられた場合、スケジューラ200は、可能な限り、同一グループのスレッドを連続して実行させるようなスケジューリングを行う。
 以上説明したように、スケジューラ、マルチコアプロセッサシステムおよびスケジューリング方法によれば、スケジューリングが済んでいない未設定処理に対して、同一のプロセッサで実行される先行処理が終了した後、即座に実行可能ではない場合には、未設定処理と後続処理とが連続実行されるように上述の未設定処理の実行開始時刻を設定することができる。したがって、未設定処理と後続処理との間の待機時間の発生するような事態が回避されるため、プロセッサの処理効率を上げることができる。
 また、上記技術によれば、さらに、スケジューリングが済んでいない未設定処理に対して、同一のプロセッサで実行される先行処理が終了した後、即座に実行可能となる場合には、未設定処理と先行処理が連続実行されるように上述の未設定処理の実行開始時刻を設定することができる。したがって、未設定処理と先行処理との間の待機時間の発生するような事態が回避されるため、プロセッサの処理効率を上げることができる。
 また、上記技術によれば、さらに、同一のグループに属する先行処理がない場合には、処理を実行していない空き状態のプロセッサに未設定処理を割り当てることができる。さらに、空き状態のプロセッサがない場合には、各プロセッサに割り当てられている処理の実行時間を考慮して最も負荷の軽いプロセッサに未設定処理を割り当てることができる。したがって、各プロセッサへの負荷が分散されるため、効率的な処理を実現することができる。
 また、上記技術によれば、さらに、優先度順位の高い処理や、割込処理、また、先行処理や後続処理を表す依存情報が付与されていない処理などを、優先的に設定されたプロセッサに割り当てることができる。したがって、優先度が高い処理は特定のプロセッサによって実行されるため、連続実行の間の割込処理の発生を防ぎ、キャッシュミスを抑えることができる。
 また、上記技術によれば、さらに、スケジューリングによって待機時間が発生した場合であっても、待機時間が規定値(任意のしきい値を設定できる)よりも短い場合には、従来のように他のプログラムの処理を実行させないように設定することもできる。したがって、待機時間の発生によってキャッシュに格納されているデータが変更になるような事態を防ぐことができる。また、待機時間が短い場合に限定することによって、プロセッサの処理効率が必要以上に低下しないように調整することができる。
 なお、本実施の形態で説明したスケジューリング方法は、予め用意されたプログラムをパーソナル・コンピュータやワークステーションなどのコンピュータで実行することにより実現することができる。本スケジューラは、ハードディスク、フレキシブルディスク、CD-ROM、MO、DVDなどのコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。また本スケジューラは、インターネットなどのネットワークを介して配布してもよい。
 100 マルチコアプロセッサシステム
 200 スケジューラ
 300 共有メモリ
 500 メモリ
 501 第1検出部
 502 第2検出部
 503 割当部
 504 算出部
 505 設定部

Claims (12)

  1.  後続処理群が共通するスケジューリングの未設定処理群を、対象プログラムを構成する処理群の中から検出する第1の検出工程と、
     前記第1の検出工程によって検出された未設定処理群の未設定処理ごとに、前記未設定処理に対する先行処理群のうち、前記処理群を同一または関連するアクセス対象データを共有するグループに分類したグループ群の中の前記未設定処理の所属グループに属する先行処理を検出する第2の検出工程と、
     前記未設定処理ごとに、前記未設定処理を、マルチコアプロセッサの中の前記第2の検出工程によって検出された先行処理が割り当てられているプロセッサに割り当てる割当工程と、
     前記未設定処理ごとに、前記未設定処理に対する先行処理群がすべて終了する実行終了時刻から、前記未設定処理の実行時間の経過時刻を算出する算出工程と、
     前記割当工程によって割り当てられた未設定処理ごとに、前記未設定処理の割当先のプロセッサでの実行開始時刻を、前記算出工程によって算出された最も遅い経過時刻から前記未設定処理の実行時間分さかのぼった時刻に設定する設定工程と、
     を前記マルチコアプロセッサ内の特定のプロセッサに実行させることを特徴とするスケジューラ。
  2.  前記設定工程は、
     前記未設定処理の先行処理群がすべて終了する実行終了時刻に、前記第2の検出工程によって検出された前記先行処理が終了する場合、前記実行終了時刻を、前記未設定処理の実行開始時刻に設定することを特徴とする請求項1に記載のスケジューラ。
  3.  前記割当工程は、
     前記第2の検出工程によって、前記未設定処理の所属グループに属する先行処理が検出されなかった場合、前記先行処理が検出されなかった未設定処理を、前記マルチコアプロセッサの中の前記先行処理が割り当てられていないプロセッサに割り当てることを特徴とする請求項1に記載のスケジューラ。
  4.  前記割当工程は、
     前記第2の検出工程によって、前記未設定処理の所属グループに属する先行処理が検出されず、かつ、前記マルチコアプロセッサのすべてに前記先行処理が割り当てられている場合、前記先行処理が検出されなかった未設定処理を、前記マルチコアプロセッサのうち、割り当て済の前記先行処理の実行時間が最短となるプロセッサに割り当てることを特徴とする請求項3に記載のスケジューラ。
  5.  前記割当工程は、
     前記未設定処理に実行順序に関する優先度が設定されている場合、前記未設定処理のうち、前記優先度が高く設定されている未設定処理を優先的に、マルチコアプロセッサの中の前記第2の検出工程によって検出された先行処理が割り当てられているプロセッサに割り当てることを特徴とする請求項1に記載のスケジューラ。
  6.  前記割当工程は、
     前記対象プログラムおよび前記対象プログラム以外のプログラムによって発生した割り込み処理を、前記第2の検出工程によって前記未設定処理の所属グループに属する先行処理が検出されなかったプロセッサに割り当てることを特徴とする請求項1に記載のスケジューラ。
  7.  前記割当工程は、
     前記マルチコアプロセッサのすべてに前記先行処理が割り当てられている場合、前記割り込み処理を、前記マルチコアプロセッサのうち、割り当て済の前記先行処理の実行時間が最短となるプロセッサに割り当てることを特徴とする請求項6に記載のスケジューラ。
  8.  前記割当工程は、
     前記対象プロセッサを構成する処理群のうち、前記後続処理群および前記先行処理群を特定する情報が含まれていない処理を、前記第2の検出工程によって前記未設定処理の所属グループに属する先行処理が検出されなかったプロセッサに割り当てることを特徴とする請求項1に記載のスケジューラ。
  9.  前記割当工程は、
     前記マルチコアプロセッサのすべてに前記先行処理が割り当てられている場合、前記後続処理群および前記先行処理群を特定する情報が含まれていない処理を、前記マルチコアプロセッサのうち、割り当て済の前記先行処理の実行時間が最短となるプロセッサに割り当てることを特徴とする請求項8に記載のスケジューラ。
  10.  前記設定工程は、
     前記第2の検出工程によって検出された前記未設定処理の先行処理の終了時刻から前記設定工程によって設定された前記未設定処理の実行開始時刻までの待機時間が、しきい値以上の場合、前記未設定処理の先行処理の終了時刻を、前記対象プログラム以外の他のプログラムの処理のうち、前記待機時間以下の実行時間の処理の実行開始時刻に設定することを特徴とする請求項1~9のいずれか一つに記載のスケジューラ。
  11.  後続処理群が共通するスケジューリングの未設定処理群を、対象プログラムを構成する処理群の中から検出する第1の検出手段と、
     前記第1の検出手段によって検出された未設定処理群の未設定処理ごとに、前記未設定処理に対する先行処理群のうち、前記処理群を同一または関連するアクセス対象データを共有するグループに分類したグループ群の中の前記未設定処理の所属グループに属する先行処理を検出する第2の検出手段と、
     前記未設定処理ごとに、前記未設定処理を、マルチコアプロセッサの中の前記第2の検出手段によって検出された先行処理が割り当てられているプロセッサに割り当てる割当手段と、
     前記未設定処理ごとに、前記未設定処理に対する先行処理群がすべて終了する実行終了時刻から、前記未設定処理の実行時間の経過時刻を算出する算出手段と、
     前記割当手段によって割り当てられた未設定処理ごとに、前記未設定処理の割当先のプロセッサでの実行開始時刻を、前記算出手段によって算出された最も遅い経過時刻から前記未設定処理の実行時間分さかのぼった時刻に設定する設定手段と、
     を備えることを特徴とするマルチコアプロセッサシステム。
  12.  後続処理群が共通するスケジューリングの未設定処理群を、対象プログラムを構成する処理群の中から検出する第1の検出工程と、
     前記第1の検出工程によって検出された未設定処理群の未設定処理ごとに、前記未設定処理に対する先行処理群のうち、前記処理群を同一または関連するアクセス対象データを共有するグループに分類したグループ群の中の前記未設定処理の所属グループに属する先行処理を検出する第2の検出工程と、
     前記未設定処理ごとに、前記未設定処理を、マルチコアプロセッサの中の前記第2の検出工程によって検出された先行処理が割り当てられているプロセッサに割り当てる割当工程と、
     前記未設定処理ごとに、前記未設定処理に対する先行処理群がすべて終了する実行終了時刻から、前記未設定処理の実行時間の経過時刻を算出する算出工程と、
     前記割当工程によって割り当てられた未設定処理ごとに、前記未設定処理の割当先のプロセッサでの実行開始時刻を、前記算出工程によって算出された最も遅い経過時刻から前記未設定処理の実行時間分さかのぼった時刻に設定する設定工程と、
     前記マルチコアプロセッサ内の特定のプロセッサが実行することを特徴とするスケジューリング方法。
PCT/JP2010/063588 2010-08-10 2010-08-10 スケジューラ、マルチコアプロセッサシステムおよびスケジューリング方法 WO2012020478A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/JP2010/063588 WO2012020478A1 (ja) 2010-08-10 2010-08-10 スケジューラ、マルチコアプロセッサシステムおよびスケジューリング方法
JP2012528534A JP5408356B2 (ja) 2010-08-10 2010-08-10 スケジューラプログラム、マルチコアプロセッサシステムおよびスケジューリング方法
US13/761,866 US9262209B2 (en) 2010-08-10 2013-02-07 Scheduler, multi-core processor system, and scheduling method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2010/063588 WO2012020478A1 (ja) 2010-08-10 2010-08-10 スケジューラ、マルチコアプロセッサシステムおよびスケジューリング方法

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/761,866 Continuation US9262209B2 (en) 2010-08-10 2013-02-07 Scheduler, multi-core processor system, and scheduling method

Publications (1)

Publication Number Publication Date
WO2012020478A1 true WO2012020478A1 (ja) 2012-02-16

Family

ID=45567458

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/063588 WO2012020478A1 (ja) 2010-08-10 2010-08-10 スケジューラ、マルチコアプロセッサシステムおよびスケジューリング方法

Country Status (3)

Country Link
US (1) US9262209B2 (ja)
JP (1) JP5408356B2 (ja)
WO (1) WO2012020478A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014027444A1 (ja) * 2012-08-13 2014-02-20 日本電気株式会社 スケジューリング装置、及び、スケジューリング方法
WO2020213396A1 (ja) * 2019-04-17 2020-10-22 株式会社エヌエスアイテクス プロセッサおよびプログラム

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012112302A2 (en) * 2011-02-17 2012-08-23 Siemens Aktiengesellschaft Parallel processing in human-machine interface applications
US9401869B1 (en) * 2012-06-04 2016-07-26 Google Inc. System and methods for sharing memory subsystem resources among datacenter applications
TWI606418B (zh) * 2012-09-28 2017-11-21 輝達公司 圖形處理單元驅動程式產生內插的圖框之電腦系統及方法
US9984430B2 (en) * 2013-04-15 2018-05-29 Intel Corporation Ordering threads as groups in a multi-threaded, multi-core graphics compute system
US20160170474A1 (en) * 2013-08-02 2016-06-16 Nec Corporation Power-saving control system, control device, control method, and control program for server equipped with non-volatile memory
GB2521155B (en) 2013-12-10 2021-06-02 Advanced Risc Mach Ltd Configuring thread scheduling on a multi-threaded data processing apparatus
GB2521151B (en) * 2013-12-10 2021-06-02 Advanced Risc Mach Ltd Configurable thread ordering for a data processing apparatus
US9785481B2 (en) * 2014-07-24 2017-10-10 Qualcomm Innovation Center, Inc. Power aware task scheduling on multi-processor systems
US9552223B2 (en) * 2014-09-30 2017-01-24 International Business Machines Corporation Post-return asynchronous code execution
US10630553B2 (en) * 2015-08-18 2020-04-21 Walmart Apollo, Llc Bandwidth throttling
CN106775975B (zh) * 2016-12-08 2020-02-14 青岛海信移动通信技术股份有限公司 进程调度方法及装置
CN109426553A (zh) * 2017-08-21 2019-03-05 上海寒武纪信息科技有限公司 任务切分装置及方法、任务处理装置及方法、多核处理器
US10817341B1 (en) * 2019-04-10 2020-10-27 EMC IP Holding Company LLC Adaptive tuning of thread weight based on prior activity of a thread
US20220121485A1 (en) * 2020-10-20 2022-04-21 Micron Technology, Inc. Thread replay to preserve state in a barrel processor

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0830562A (ja) * 1994-07-19 1996-02-02 Nec Corp マルチプロセッサシステム
JPH09231183A (ja) * 1995-10-26 1997-09-05 Hitachi Ltd リアルタイム分散処理システム
JP2005049922A (ja) * 2003-07-29 2005-02-24 Hitachi Ltd ジョブ実行計画の評価システム
JP2005258920A (ja) * 2004-03-12 2005-09-22 Fujitsu Ltd マルチスレッド実行方法、マルチスレッド実行プログラム、およびマルチスレッド実行装置

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10134030A (ja) 1996-05-22 1998-05-22 Fujitsu Ltd マルチメディアデータ・プレゼンテーションシステムおよび方法
US6687257B1 (en) * 1999-08-12 2004-02-03 Rockwell Automation Technologies, Inc. Distributed real-time operating system providing dynamic guaranteed mixed priority scheduling for communications and processing
DE10085287T1 (de) * 1999-12-08 2003-03-27 Univ British Columbia Zeitplaner für einen gewichteten fairen Warteschlagenbetrieb
US6957432B2 (en) * 2000-03-21 2005-10-18 Microsoft Corporation Real-time scheduler
US6938252B2 (en) * 2000-12-14 2005-08-30 International Business Machines Corporation Hardware-assisted method for scheduling threads using data cache locality
JP4177681B2 (ja) 2003-02-20 2008-11-05 学校法人早稲田大学 コンパイル方法、コンパイラ、およびコンパイル装置
US7206950B2 (en) * 2004-06-16 2007-04-17 Matsushita Electric Industrial Co., Ltd. Processor system, instruction sequence optimization device, and instruction sequence optimization program
JP2006099156A (ja) 2004-09-28 2006-04-13 Sony Corp 情報処理装置および方法、並びにプログラム
JP4074296B2 (ja) * 2005-03-25 2008-04-09 株式会社東芝 スケジューリング可能性判定方法、リアルタイムシステム及びプログラム
US8156495B2 (en) * 2008-01-17 2012-04-10 Oracle America, Inc. Scheduling threads on processors

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0830562A (ja) * 1994-07-19 1996-02-02 Nec Corp マルチプロセッサシステム
JPH09231183A (ja) * 1995-10-26 1997-09-05 Hitachi Ltd リアルタイム分散処理システム
JP2005049922A (ja) * 2003-07-29 2005-02-24 Hitachi Ltd ジョブ実行計画の評価システム
JP2005258920A (ja) * 2004-03-12 2005-09-22 Fujitsu Ltd マルチスレッド実行方法、マルチスレッド実行プログラム、およびマルチスレッド実行装置

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014027444A1 (ja) * 2012-08-13 2014-02-20 日本電気株式会社 スケジューリング装置、及び、スケジューリング方法
JPWO2014027444A1 (ja) * 2012-08-13 2016-07-25 日本電気株式会社 スケジューリング装置、及び、スケジューリング方法
WO2020213396A1 (ja) * 2019-04-17 2020-10-22 株式会社エヌエスアイテクス プロセッサおよびプログラム
JPWO2020213396A1 (ja) * 2019-04-17 2020-10-22
JP7456437B2 (ja) 2019-04-17 2024-03-27 株式会社デンソー プロセッサおよびプログラム

Also Published As

Publication number Publication date
JP5408356B2 (ja) 2014-02-05
JPWO2012020478A1 (ja) 2013-10-28
US9262209B2 (en) 2016-02-16
US20130160023A1 (en) 2013-06-20

Similar Documents

Publication Publication Date Title
JP5408356B2 (ja) スケジューラプログラム、マルチコアプロセッサシステムおよびスケジューリング方法
US11507420B2 (en) Systems and methods for scheduling tasks using sliding time windows
EP3129880B1 (en) Method and device for augmenting and releasing capacity of computing resources in real-time stream computing system
US8793693B2 (en) Apparatus and method for predicting a processing time of a computer
KR101644800B1 (ko) 컴퓨팅 시스템 및 방법
JP5650952B2 (ja) マルチコア/スレッドのワークグループ計算スケジューラ
JP4621786B2 (ja) 情報処理装置、並列処理最適化方法およびプログラム
US8875146B2 (en) Systems and methods for bounding processing times on multiple processing units
JP2008065713A (ja) マルチプロセッサシステム及び割込み制御方法
EP2613257B1 (en) Systems and methods for use in performing one or more tasks
JP5765423B2 (ja) マルチコアプロセッサシステム、およびスケジューリング方法
CN109840149B (zh) 任务调度方法、装置、设备及存储介质
KR101392584B1 (ko) 리소스 모니터링을 이용한 동적 데이터 처리 장치 및 그 방법
CN113316767A (zh) 处理器处的松弛度感知、动态优先级变化
JP5321748B2 (ja) マルチコアプロセッサシステム、スレッド制御方法、およびスレッド制御プログラム
JP6372262B2 (ja) 印刷装置、およびプログラム
US20220237016A1 (en) Apparatus for determining resource migration schedule
JP5737298B2 (ja) スケジューリング方法およびスケジューリングシステム
JP6428557B2 (ja) 並列化方法、並列化ツール
JP6524733B2 (ja) 並列演算装置、並列演算システム、およびジョブ制御プログラム
JP2010182199A (ja) ジョブスケジューリングシステム、方法、及びプログラム
JP2017107486A (ja) 処理リソース制御プログラム、処理リソース制御装置、および処理リソース制御方法
JP6537372B2 (ja) 画像形成装置、画像形成装置の制御方法、及びプログラム
JP3951230B2 (ja) プログラム割当制御方法とプログラムおよびプログラム割当制御システム
JP2021189461A (ja) ジョブスケジューリングプログラム、情報処理装置及びジョブスケジューリング方法

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: 10855879

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2012528534

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10855879

Country of ref document: EP

Kind code of ref document: A1