One of the main goals of the Avian Computing Project is to reduce the length of time it takes to develop parallel computer programs. In this post, we’ll look at how focusing developers on the overview perspective will help us achieve our goal.
Developers/humans work better at the overview level. For example, if I say, “let’s send a person to the moon,” we all have a pretty good idea of what’s going to happen. But if every person who works on the moonshot is required to know every single detail, that trip may never happen because everyone will be trying to do every job and interfering with each other. If we can take an overview perspective, however, we can break the moonshot into logical tasks, such as propulsion, life support, computational, etc., and again break each task into subtasks and so on until everyone has a reasonably-scoped amount of work that they can perform without interfering with others.
In the Avian Computing environment, the overview perspective is provided by thinking about controlling a flock of birds who will together accomplish one goal or task in parallel. Some types of birds in the flock will perform one part of the process while other types of birds will perform other parts of the process.
The overview perspective is provided again by the diagram of the standard life cycle of a bird (thread). The threads don’t really undergo this life cycle (threads can’t really eat); instead this conceptual overview provides us with enough knowledge about Avian Computing that developers can use the Concurrency Explorer framework (ConcX) to produce parallel applications in relatively short lengths of time.
The overview perspective is easier with the Avian framework is because it handles all the locking and synchronizing automatically, inside the framework. This eliminates spending time thinking about mutexes and synchronizing and deadlocking and all of the related junk that developers normally have to contend with when developing parallel applications. It accomplishes this by borrowing some concepts from the Linda parallel programming construct and adapting them to the bird metaphor. Linda was pioneered by David Gelernter in mid-80’s and developed with Carriero & others into the ’90s. Linda manages information in tuples and threads select and work on tuples that meet their specified conditions.
Birds spend a lot of time in trees, so in the Avian environment, the birds find and eat all of their food from the TupleTree. When they are done digesting their food, they store their food (results) back into the tree. In Linda-speak, these are the in() and out() functions.
All of the locking and synchronizing is managed by the TupleTree. The TupleTree manages all requests by birds to get food and to store food as synchronized methods. If a bird gets some food to eat, that food is removed and gone from the tree, guaranteeing that multiple birds cannot access it. And once a bird has a chunk of food (object), it has complete control over it. No other bird is aware of that food object unless and until it is stored back in the tree.
Avian developers are encouraged to NOT think in too much detail about which individual bird (thread) actually performs any given task. Neither should the order of the food objects in the tree be considered or depended upon. Developers should focus on how to break any given task into subtasks and translate those subtasks into food types, the kind of logic that is best done at a higher level, at an overview level.
By thinking at the overview level in the Avian environment, we can think through the tasks and subtasks that we want our parallel program to perform and then rough out those tasks in ConcX. And then, best of all, we get to run the rough application and verify that it’s doing what we want. If not, it is simple enough to change the order that the tasks are performed in or to add or subtract, combine or split tasks.
This is one of the strengths of the Avian Computing environment; the birds in your flock are loosely coupled and work independently, giving you great flexibility in achieving your goals.