In an ideal world, I would not have two counters to figure out if a job is done. There is always a problem of rightly updating them on exceptions and other edge cases. The worst case scenario is we'll get stuck in this "while" loop. Can you think about it a little bit? I'll do the same.