Thursday, November 5, 2009

Armstrong Thesis (Chapter 6)

Last night I finished reading Chapter 6 of Joe Armstrong's thesis on building fault-taulerant software. The chapter was primarlily about putting together alot of what we have learned into some concrete examples. The chapter showed code relating to the various behaviours and supervision models that we had learned about previously. I have to say that I am a big fan of examples. I think they help to solidify my understanding of the material.

Chapter 6 is the last chapter that we will be reading in CS 527. Having about 12 years of industry experience under my belt, I can't help but think about why I had never heard of Erlang before. Is it because I have worked primarily on projects dealing with standard line of business type apps in companies whose core businesses were not technology related? Hmm.

I also wonder about the adaptability of these concepts to other langauges. Could the concepts such as supervision trees that are first class citizens be adapted to a language like C# and maintain the same sort of effect?

Wednesday, November 4, 2009

Pipeline, Geometric Decomposition, Data Parallelism

Three of the readings for tomorrow's class are on parallel algorithm strategy patterns. We discussed a few of these in yesterday's class as well. The three for discussion tomorrow are the pipeline, geometric decomposition and data parallelism patterns.

The pipeline pattern is probably the pattern that I had heard/read the most about previously. This pattern is as you would expect; stages of the pipeline are executed concurrently to exploit the parallelism present.

The geometric decomposition pattern breaks the input problem space/data structure into chunks and processes the chunks in parallel. Some of the concerns with this pattern are in regards to chunk granularity and data dependencies between chunks.

The data parallelism pattern writeup could us a bit more detail :). Data parallelism exploits situations where the same computation is performed on different input data. These computations can then run concurrently.

Having read numerous parallel patterns over the past few weeks, I think I have done myself a bit of a disservice by not having programmed on any large scale parallel systems. I think having some real world experience in this area would go a long way with understanding these patterns.

Tuesday, November 3, 2009

Armstrong Thesis (Chapter 5)

In Chapter 5 of Joe Armstrong's thesis, we are introduced to programming fault tolerant systems. Joe begins the chapter discussing the concept of falling back to simpler tasks if what ideally should be done cannot. The idea is that simpler tasks mean simpler code and in theory should be able to succeed even when the more complex tasks cannot. I think Erlang works well with this sort of methodology. Attempting to do this type of fallback in other languages such as C/C++/Java/C# is not always as straightforward as it could be.

Joe also discusses the concept of supervisors in more detail. We were introduced to them in earlier chapters, but in this chapter we began to dig in a little deeper and look at AND vs. OR supervisors. Child tasks monitored by AND supervisors are always restarted together. The premise being that the tasks work in conjunction so if one fails they should all fail. The tasks for OR supervisors are handled independently.

The chapter concludes with discussion on what exactly constitues an error. In my view, an error is essentially any type of problem that was unaccounted for in the code. I think Joe's definition is much more poetic, but in the end I think our philosophy is essentially the same. Again, another good read. On to chapter 6...

Task Parallelism, Recursive Splitting, Discrete Event

Part of today's class discussions will be about the three patterns identified in the title of this post. These patterns fall into the parallel algorithm strategy class of patterns. Essentially, the patterns address issues on how we exploit parallelism to better solve the problem at hand.

Being somewhat new to the world of parallel patterns, I was able to get a basic understanding of the discussion points of each pattern and the rationale behind them. I will say though that as the number of patterns that we read increases, it is sometimes more unclear as to how certain patterns are differentiated from others. I am hoping the discussion in class will be lively and I will pick up a deeper understanding of each of these three patterns.