1. A computer implemented on-line scheduling method comprising: based on scheduling states, defining a set of static schedules for an application program, each static schedule including an assignment of tasks in the application program to processors, each scheduling state including dynamically changing application variables; during run time, learning a cost of a set of static schedules based on performance of the application program; and designating a static schedule with a lowest cost as an optimal schedule for a scheduling state.