Parallel Architecture: From Adhocracy To Bureaucracy

These past few weeks I have been busy to the extreme. Some good events and some are less happy events. The most important of which is having our first baby boy. You can really test your time management skills when you have no time... A wise man once told me that there is always time: 24 hours per day. Having enough time depends of what you plan to do with it. People can't work 24 hours a day. There is something else other than time, things like concentration, focus, commitment... These depend on how interesting is your job and what else would you like to do. If you really try you might be able to put that aside and still invest enough efforts in your work. There is another thing which is more interesting for this discussion: Interruptions.

We called our baby boy Gad. Gad is one of the sons of Jacob in the bible (See wikipedia), he was number 7 in the list of 12. In Hebrew the meaning of the name Gad is luck and when adding the value of the Hebrew letters we get 7 (Gimatria). We are fortunate to have him. He is a good boy at the age of 3 and a half weeks. (Here he is at half that age: GadShelly). We didn't name him Gad because of good luck. Everyone around us are giving special and unique names to their kids, we figured it would be best to give him the simplest name we can find and let him cast his own character into this name.

Good boy or not, he is always seeking attention. A month ago my cellular phone was interrupting me when I was trying to put all my focus into something. If right now while I am writing these lines I had a phone call, I would probably not even get up to see who this is. I'll get back to them. Everyone who knows me already know to call me from a familiar number so I can get back to them. Before I sat down to write these lines I made myself a cup of tea. It is cold by now because I found myself going over emails and then writing this post. I have been wanting to get up to do something about this cup of tea, and it is still on my to do list. If I get up for something else hopefully I will remember to take the cup with me. I did however get up immediately when Gad was making a few noises. Love and care had nothing to do with it. There is something else there.

Babies are very demanding but this is not because they would interrupt more times or more rapidly. There are days when my phone would ring too often for me to do any work if I answered it. People came back from vacation, end of year and everyone need to clean things up etc. My cell phone plays a music I like. Calls from family members can have different a music. This is just like the CPU having Interrupts with several different priorities. This priority is according to the source of the event. If I want to know the urgency of the event I would have to pick up the phone and ask, or engage in a higher level protocol, just like a PCI Interrupt can be a mouse click or an out-of-battery event. If you call me two consecutive times I figure this has to be important so I will probably pick it up. If it wasn't then the next time you call me two consecutive times I will ignore...

Babies have a very low tolerance level. A baby can sleep for an hour and then wake up, look around and say "aa", "ooa", "we-a". This means something like "I am awake", "Food", "Food". If you do not respond then immediately they would start crying which means "Help me!",  "Help me!". If you do not respond to this then ten seconds after this the crying escalates to  "Emergency!",  "Emergency!". If you responded in time then the crying stops, as long as things are going in the general direction. When the baby figures out "Hey, this guy is just picking me up, where is the food?" we go back to escalation.

Right after child birth, we were at the hospital for two more days, and Gad was with us the whole time. They let you keep the baby with you if you want. I was with my wife so we took shifts taking care of him. For anyone who would prefer to get some sleep, the hospital has nurses in a nursery with which you can leave the baby and come back for feeding whenever you want. We were in that room for our baby's physical tests. A long and wide room full of tiny little babies. Statistically you would have 2 to 6 babies crying at any given time. Taking care of them are 3 to 5 nurses. Some of them do physical tests to other babies so they are 'out of resources' to handle every baby's  "Emergency!" call. It seems that most times babies would call  "Emergency!"  "Emergency!" and a minute later would forget about it and go back to sleep, or maybe they just get tired and reserve their energy for something else.

Some mothers ask the nurses to call them when the baby is crying, so if a baby is crying for long enough and there is a free nurse the mother would get a call. This makes the nurse teams into a dispatcher. Actually they are a collection of dispatchers with different tasks and responsibilities. If the mother didn't come to breastfeed for a long time, the nurses would feed the baby using a bottle. In this system every one of the clients define their event as hi- priority and the server decides who is really hi- priority by other parameters such as persistence, and understanding client's internals.

Imagine a web server which is now out of resources, flooded with requests. Some requests have to be ignored. Simple requests such as "give me your home page" can be answered because they are cheap to handle. A request for "Get all my friends list" requires some database action and the database is too busy. The request is ignored and the client will have a "refresh my list" button enabled so the user can ask again later. When a client is saving a document, this request will not give up so easily and the connection will remain open for up to 120 seconds. The web server will see a persistent connection and will figure that this has to be important if the client is willing to waste time for the action to complete. This describes a system which by design states that if an event is really important then the client would invest resources and efforts on making sure it is served. Do you know of such a system?

This sounds like a good plan for a system. Clients are eventually operated by people. If you have an HPC Cluster and the user can set the priority of his own tasks... well... In modern Hebrew there is a saying which loosely translates to The cook does not testify for his bakery. Maybe some student has a hot date and wants his tasks to finish first and that would slow down other tasks which are more important in the bigger picture. Priorities are dependant on the source of the request, but persistence and the amount of effort you are willing to invest in a request is also not a really good factor. It is possible that a young kid playing an online computer game be more persistent than a CEO of a big company trying to access his online bank account.

There are many systems who deal with a variety of requests from different people. Most of these systems are run by people and they make the final decision but most times there are clear-cut rules to what should and should not happen and how to handle a given request. Sometimes the system would initiate a follow-up interaction with a client in an attempt to understand the urgency and necessity of the request.  Such a system is called a "Bureaucracy".

A Bureaucracy is both good and bad. A national organization without bureaucratic rules will end up being corrupted. On the other hand a bureaucratic organization can sometimes be detached because the person making the request does not fit the profile of high priority client, which is a result of an imperfect rule base. Sometimes it is good that the system is indifferent to clients because an online game is not as important as police communications but as an individual you cannot see the big picture. If my HPC cluster could ask the student for the reason of urgency of his task and there would be something like "Personal" -> "Romance" -> "First Date", then my HPC cluster would know that it is not as important as "Personal" -> "Romance" -> "Wife's Birthday". Maybe this is too detailed but you get the point.

Today our software operates huge systems that justify Bureaucracy but their design is more similar to an Adhocracy.

For more complete information about compiler optimizations, see our Optimization Notice.