In this paper, a two-machine two-stage flow shop with identical jobs is considered. Each of identical jobs has two tasks. The first task can be processed on either machine, called flexible task, while the second task must be processed on the second machine and can't be processed unless the first task has been processed. The problem is to determine the assignment of the flexible tasks to the machines for each job, with the objective of maximizing the throughput rate. This model is applied to the graphic programs processing which comprises data processing and graphics processing. We consider three cases regarding the capacity of the buffer between the machines with infinite number of jobs. We present optimal algorithm for each variant of the problem.