A method for executing tasks in a multiprocessor system including a plurality of processors, each processor taking either an "idle" state and a "run" state, and each task taking either a "stopped" state, a first "executed" state and a second "executed" state,
- wherein the method comprises the steps of:
- when a first processor among the plurality of processors that is executing a first task newly generates a second task, the first processor detecting whether or not a second processor taking the "idle" state exists among the plurality of processors;
- assigning the second task, if a second processor taking the "idle" state is detected, to the second processor, so as to begin execution of the second task by the second processor, change the state of the second processor from the "idle" state to the "run" state, and change the state of the second task from the "stopped" state to the first "executed" state;
- and
- suspending, if no second processor taking the "idle" state is detected, the execution of the first task by the first processor, beginning execution of the second task by the first processor, and changing the state of the second task from the "stopped" to the second "executed" state.