Optimal Schedules for Parallelizing Anytime Algorithms: The Case of Shared Resources