Before revision:  We give an optimal algorithm for scheduling multistage jobs  and an exact response time analysis of our algorithm . As a special case of our analysis, we obtain the first closed-form expression for mean response time under the Gittins index policy in the M/G/1 queue .
After revision:  We give an optimal algorithm for scheduling multistage jobs and an exact response time analysis of our algorithm .