INFORMATION PROCESSING APPARATUS
To realize a situation that while the number of inspection performed on a stack used as a variable storage area is reduced, a use efficiency of a CPU is improved and the stack used as the variable storage area is preferably inspected. In a cellar phone according to an embodiment of the present invention, a main control section controls an execution of an intermittent operation in the cellar phone, when the cellar phone returns from the intermittent operation in accordance with the control, a timer for a stack inspection is set in a first state, and each time the timer for the stack inspection times out, the stack inspection is executed.
1 . An information processing apparatus, comprising:
an intermittent operation execution control unit configured to control an execution of an intermittent operation in the information processing apparatus;
a timer setting unit configured to set a timer for a stack inspection in a first state if the information processing apparatus returns from; the intermittent operation in accordance with a control of the intermittent operation execution control unit; and
a stack inspection execution unit configured to execute the stack inspection each time the timer for the stack inspection set by the timer setting unit times out.
2 . The information processing apparatus according to claim 1 , further comprising:
a system control unit configured to return a system to an original state in a case where it is determined as a result of the stack inspection executed by the stack inspection execution unit that a variable storage area in the stack is damaged.
3 . The information processing apparatus according to claim 1 , wherein in a case where the intermittent operation is executed in the information processing apparatus by the intermittent operation execution control unit, the timer setting unit sets the timer for the stack inspection in a second state.
4 . The information processing apparatus according to claim 3 , further comprising:
a first determination unit configured to determine whether a thread in which the stack inspection can be executed is operated in accordance with the control of the intermittent operation execution control unit if the information processing apparatus returns from the intermittent operation,
wherein in a case where the first determination unit determines that the thread in which the stack inspection can be executed is operated, the timer setting unit sets the timer for the stack inspection to be switched from the second state to the first state.
5 . The information processing apparatus according to claim 4 , wherein in a case where the first determination unit determines that the thread in which the stack inspection can be executed is not operated, the timer setting unit keeps the setting of the second state in the timer for the stack inspection.
6 . The information processing apparatus according to claim 4 , further comprising:
a second determination unit configured to determine, in a case where the first determination unit determines that the thread in which the stack inspection can be executed is operated, after the timer setting unit sets the timer for the stack inspection to be switched from the second state to the first state, whether the thread in which the stack inspection can be executed is ended,
wherein in a case where the second determination unit determines, after the timer setting unit sets the timer for the stack inspection to be switched from the second state to the first state, that the thread in which the stack inspection can be executed is ended, the timer setting unit sets the timer for the stack inspection to be switched from the first state to the second state.
7 . The information processing apparatus according to claim 4 , wherein in a case where the first determination unit determines that the thread in which the stack inspection can be executed is newly operated, the timer setting unit sets the timer for the stack inspection to be switched from the second state to the first state.
8 . The information processing apparatus according to claim 1 , further comprising:
a flag setting unit configured to set, if the timer setting unit sets the timer for the stack inspection in the first state or the second state, a flag indicating that the timer for the stack inspection is set in the first state or the second state,
wherein in a case where the timer setting unit sets the timer for the stack inspection in the first state, if all the flags set by the flag setting unit are set as the flags indicating that the timer for the stack inspection is set in the second state, the timer setting unit sets the timer for the stack inspection in the second state.