Pancakes and queues.

I like cooking food: from small meals for one to large multi-course meals for a party, food cooking to me is not just the fun of preparing food but it is also a good way to experience queue theory and project management in a physical way beyond spreadsheets and gantt charts..

A good cook is a good project manager. Delivering a meal is not only an exercise in the skill of preparing the ingredients but it is very much an exercise in timing deliverables. Not much use if your perfectly prepared fish is now waiting for the rice or vegetables to finish cooking or for the salad leaves to be washed.

Same with queue theory:one off productions don’t usually hit queue theory but when you start to make a batch of repeat items then quite naturally you will want to make this more efficient and prepare the food as a queue.

I was making pancakes on the weekend and to speed up the delivery rate I use two fry-pans but rather than cooking two pancakes in parallel i.e. two servers, I decided to cook the pancakes as a pipeline i.e. a series of two servers but the service time for each server is halved. Start off the pipeline by cooking one side of the first pancake on one fry-pan and then when that first side is ready I flip that into the second fry-pan.

The first fry-pan then gets the side one of the next pancake and so on. This allows me to fine-tune the quality of the pancake i.e. the deliverable, on the second fry-pan and ideally the “goodput” i.e. the throughput of actual pancakes should be at a mean departure rate that is the worse-case time taken to cook one side.

We don’t have two gas hobs with the same flame rate so used the medium flame on the first fry-pan and a lower flame on the second thinking that it should suffice.

Within 1 pancake the pipeline was stalling. The second pan was taking too long to cook properly and so I had to take the first pan with a waiting 1/2 cooked pancake off the heat. I had to put the second fry-pan onto a larger hob and so the cooking time for the second side was now faster but the second fry pan after 1 round was now waiting for the first one to finish the first side.

The lesson here is that a pipeline is as efficient as the worse-case service time of all the servers in the pipeline. If any server stalls then the whole pipeline stalls and if any server is too fast then it ends up being idle.

A better strategy for pancakes if you have multiple fry-pans is to cook all of each pancake in each frypan and not try and pipeline the cooking steps unless you can guarantee an equal cooking time for each step,

They tasted great though in the end even if the queuing strategy that was chosen was wrong for this kitchen environment. By the way – the recipe I use is just a scaled up version of the BBC one here though I don’t use butter as a grease but just use a non-stick pan.