Integrating Queueing Theory and Scheduling for Dynamic Scheduling Problems