simple software base scheduler in main loop