1. A computer-executed method for reducing stalling in a pipeline of a processor having a simultaneous multithreading function, the method comprising the steps of: detecting occurrence of stalling; identifying, based on data dependency, whether or not there is another instruction (second instruction) on which a stalled instruction (first instruction) is data dependent; registering the identified second instruction; and inserting an instruction instructing fetching of an instruction from another thread different from a thread being executed with respect to subsequent executions of the registered second instruction so the thread being executed is switched after the second instruction has been fetched and before the fetching of the first instruction, wherein at least one of the steps is carried out using a computer.