Avian Computing – Overview

macawThe Avian Computing Project seeks to reduce the length of time it takes to develop parallel computer programs by improving how we think and talk about parallel programs. To accomplish this goal, the Avian Computing Project replaces the current mental programming model (based on “math equation-ish” lines of code) with a mental model based on natural group elements, such as birds or ants or fish. The advantages are discussed in blogs about using a nature-based model to encourage overview level thinking while reducing exposure to program code. These aspects were chosen based on the guidelines for the next generation development model that were derived based on the limitations of the human brain AND the shortcomings of developing computer programs using languages.

Flock of Birds

Using a flock of birds as the model for hundreds or thousands of processors/cores will make it easier to develop programs that can use all those cores

One basic assumption of the Avian Computing Project is that the number of processors or cores available in each computing device will continue to increase until hundreds or thousands of cores will be available in each system. While the technology to physically build such devices currently exists (for example, the hundreds of cores currently available in Graphical Processing Units (GPU) in our graphics cards), we do NOT have a way of quickly and efficiently building the software that can make use of all of those cores.

The Avian Computing Project focuses on reducing parallel program development times by making it easier to think and talk about parallel operations. It does this by emphasizing nature-based models instead of lines of code. The primary goal of Avian Computing is NOT to make apps that run faster in parallel but instead to make it faster to get parallel apps running. When the tasks in an app are correctly apportioned and distributed among the (potentially hundreds of) cores available, the speed issue will take care of itself.

All birds follow this basic life cycle

All birds follow this basic life cycle

The Avian Computing environment also provides a standard framework (the Concurrency Explorer or ConcX) to configure and launch birds (threads). All birds have a runtime life cycle that resembles the natural behavior and life cycle of birds. Birds are hatched, look for food, eat it and digest it, store the resulting food and then take a nap before doing it all again. They also reproduce when they are well fed and die off when they cannot get enough to eat. The only coding that needs to be done by the developer is describing what is done during the digestion phase; the rest is accomplished by selecting and configuring the right birds.

All of the fussy details about thread locking and deadlocks that are normally agonized over in parallel programs are handled by ConcX so the developer doesn’t have to. This isn’t a convenience or just some handy feature; instead it was considered an absolute necessity to hide all locking in the framework so developers can focus solely on making the program work correctly. Same for starting new threads and stopping un-used threads and thread sleep; it’s all handled in the framework so the developer doesn’t waste time thinking  about them.

The Avian environment and ConcX borrow the concept of the Tuplespace from Linda, the parallel programming constructs developed by David Gelernter and Carriero and others back in the 1980’s and 1990’s. In the Avian environment, every bird gets its food from the TupleTree and stores its results back in the TupleTree. All locking is automatically managed by the TupleTree when food (objects) move in or out of the tree. The TupleTree is the only place where locking is required and the TupleTree does it all invisibly for the birds. When a bird looks for food, it “requests” a specific food type. The TupleTree locks itself as required and returns a matching food object if it has one or returns null if it does not. A basic diagram of the Avian Computing Environment is shown below.

Basic Avian Diagram

All birds feed in the TupleTree, eating a specific food and storing a specific food. The birds feed asynchronously at the rate appropriate for the task that they are performing.

When a bird receives a food object from the TupleTree, it has the only copy of that object and is the only bird that can make changes to it while it possesses it. (Other instances of the requested food type may still be in the TupleTree, just like a real tree will normally have more than one fruit or seed).

As the bird is digesting the food object, it is performing some work or applying some transforms to the data contained in the food object. When its work is completed, the bird normally stores one or more food objects back in the TupleTree where other birds can eat the resulting food.

Napping allows the processors to share resources – basically so all the threads play nice together. The maximum nap length is configurable by the developer in ConcX. The actual length of each nap is a randomly selected duration between 0 ms and the (maximum) nap length set by the developer.

Logging is internally maintained by each bird and internally to each food item. The internal bird logs are viewable in ConcX immediately after a bird is stopped. The internal food logs are listed on the TupleTree tab of ConcX; each food item listed contains a timestamp of when each action was made and which bird made the action.

By carefully analyzing the logs, issues can be researched and problems identified. The logs are written in CSV format and can be saved to files and then opened with spreadsheet programs. It has been very useful to be able to find what every bird was doing at an exact moment in time. Again, because this is all handled automatically; the developer doesn’t have to worry about them.

All together, the Avian Computing project tries to provide the concepts, tools and resources needed to quickly develop parallel programs. The Avian Computing project encourages us to think about parallelizing applications and stop thinking about code.

Leave a Reply

Your email address will not be published. Required fields are marked *