Thursday, November 5, 2009
Armstrong Thesis (Chapter 6)
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
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)
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
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.
Thursday, October 22, 2009
Armstrong Thesis (Chapter 4)
In Chapter 4, Joe introduces us to a couple of concepts. Specifically, the chapter discusses some high level concepts for programming with Erlang such as keeping concurrent and sequential code as separate processes, the overall ideology behind error handling and the concept of letting a process die on error while another process monitors for errors (workers/supervisors).
The chapter wraps up with a brief discussion on intentional programming. I thought this discussion, albeit brief, was interesting. The general concept is that your code should be easily understood and one of the examples given was about a lookup method which could be used in three different contexts, depending on the developer's intent. Armstrong points out that a better approach would be to make this three separate methods. That way it is clear what was meant by the calling function. I think there is definitely some merit to this approach and I really don't think it is specific to Erlang.
As time permits, I would like to write a program using Erlang. I like the ideas we've seen so far and find it interesting. Any ideas for a good project to get started?
Dense Linear Algebra, Graph Algorithms, Monte Carlo
Having done very little programming (with emphasis on the very little part) for large parallel systems these patterns were new to me. The patterns made sense and after reading them I think they were clearly documented. I particularly liked reading about the trade-offs and forces in play such as data movement costs vs. computation time for the dense linear algebra pattern, data structure choices for graph algorithms and threading/SIMD allocation in monte carlo simulations.
Hopefully in tonight's discussion there will be students who have work with these patterns. I look forward to hearing about their experiences.
Monday, October 19, 2009
Armstrong Thesis (Chapter 2)
For this week's reading we focused on Chapter 2 which introduces the architectural model being proposed. The chapter begins by introducing the original problem domain (telecom switching systems requiring essentially 24/7 operation with the ability to be updated while running). Oh wait ... did I mention that we are also going to assume that there will be hardware & software errors and that the system has to be able to work around such issues? Not an easy task!
Armstrong approaches the problem through the use of what he calls "concurrency oriented programming languages" (COPLs). COPLs typcially consist of and must support the concept of processes to serve as isolation boundaries. Communication between processes is achieved through message passing. Message delivery is guaranteed in-order between two endpoints, but is not guaranteed reliable. The other key feature is that processes must be able to detect failures of other processes and react accordingly. Armstrong introduces the Erlang language as one such implementation.
The remainder of the chapter discusses library support of Erlang for things like stable storage (storage that survives a crash) and various behaviours that assist with building these systems.
In subsequent weeks we will be reading additional chapters from Armstrong's thesis. If chapter 2 is any indication, this seems like it will be a good read.
"Event-Based" and "Map-Reduce" Pattern
Two patterns we will be discussing in class tomorrow are "event-based, implicit invocation" and "map-reduce". The event-based pattern is a little light on details, but is straightforward enough. In this pattern, there are:
- components acting as announcers (posters of events) and/or listeners (subscriber of events)
- a medium which acts as communication fabric hooking together announcers and listeners
With this pattern, one of the keys is that announcers are not aware of which listeners (if any) are present. This combined with the asynchronous nature of the system makes for a great architecture. However, I think that implementing the "medium" is a non-trivial task that is somewhat glossed over.
The other pattern, map-reduce, is another fairly simple pattern. The concept is that you have a map function that can be applied concurrently to all objects in a given set and then the results of each operation are reduced through a reduction function. This is an excellent pattern for problem domains that fit as the only thing that really has to be done is the creation of the map function and the reduction function. I would be interested to see some actual implementations of this pattern and see how well they scale as object counts increase. In naive implementations, I think there could be some potential lock contention scalability issues with the task queue and repository perhaps?
Tuesday, October 13, 2009
Refactoring for Reentrancy
Rereading the Classics (BA ch 14)
The final chapter introduced Smalltalk. Having come from a predominantly C/C++/C# background, I have to say this language took me a bit to wrap my mind around. I liked what I saw. I think the language deserves a lot of credit in paving a new way of approaching things even if it is not necessarily considered "mainstream".
The last section in the chapter introduced several different structures created by famous architects. Some of these structures while considered beautiful and works of art were not necessarily the most habitable of places. One such structure was deemed inhabitable by its occupants, but yet is still looked at as a modern architectural marvel. This begs the question ... can form and function not be counteractive forces? I think so.
Wednesday, September 30, 2009
A Java Fork/Join Framework
Overall, the framework is pretty small. I think I saw a quote in the write-up that the entire framework was somewhere around 800 lines of code. At a high level, the framework uses a thread pool with task runners to execute tasks. This avoids some of the performance penalties associated with the Java Thread class. I liked the work-stealing algorithm implemented using the double-ended queues.
Performance of the framework seemed to be reasonable. I would be interested in seeing updated performance results using a more recent version of the JRE. I think when this paper was published, the author used version 1.2 of the JRE which is fairly outdated in today's standards.
GNU/EMACS: Creeping Featurism is a Strength (BA ch 11)
I liked the way in which Emacs handled the buffers, frames and windows isolating the complexity of screen refreshes from the add-on developer. Only having to focus on the core "business logic" of the macro is a big plus.
I think a big reason for Emacs success is in its flexibility and ease with which its base functionality can be expanded upon. It reminds me of two separate systems that I have worked with in the past. Both systems contained screens with a bunch of buttons that could be used to carry out various tasks. One of the systems exposed an object model and allowed users the ability to link the button presses to custom javascript functions. These javascript functions could then manipulate the DOM as desired. The other system was identical in purpose, but the logic for the button actions were compiled into the application binary. Any changes to the button press functionality would require modifications to the application. One of these applications was successful and the other was viewed by many as a failure. Do you want to guess which one was successful?
Monday, September 28, 2009
Our Pattern Language
Metacircular Virtual Machines: Jikes (BA ch 10)
The obvious question for such systems is how are they bootstrapped? A good portion of the chapter is spent talking about how this feat is accomplished and the overall design of the system. I personally liked the portion of the chapter that talked about some of the virtual machine myths.
While Jikes is interesting, my overall question as with the JPC case study is the applicability of the system and how/where it would be used. I think it the case of both systems there are some definite academic uses.
Adaptive Object Model Architectural Style
Early in my development career I used to despise systems like these. They were hard(er) for junior developers to understand and get up to speed with. But as I matured a bit, I see the value in systems like this. Not having to interrupt my current work to go back and make changes to previous systems to support new requirements is a great plus for everyone involved. The business can adapt quicker and hopefully there will be fewer potential bugs as well.
Building the GUI of such systems can be challenging though. The chapter introduces some concepts on how to handle this issue along with some good case studies. Overall, two thumbs up!
JPC: Java x86 PC Emulator (BA ch 9)
I will admit though the authors make a pretty good case (although I am still not sure I am fully a believer). I did like some of the discussion on the performance challenges the authors faced specifically in regards to the complexities of class loading and the processor protected mode/memory performance bottlenecks.
All in all it was interesting learning about the platform and the java performance tips that were shared. But my question still stands … is it useful for anything other than research? What do you think?
Sunday, September 20, 2009
Big Ball of Mud
Guardian: A Fault-Tolerant Operating System (BA ch 8)
Wednesday, September 16, 2009
Layered Architectures
Xen and the Beauty of Virtualization (BA ch 7)
Friday, September 11, 2009
Facebook: Data Grows Up (BA ch 6)
Pipes and Filters
Excerpts from Christopher Alexander
Resource-Oriented Architectures (BA ch 5)
Wednesday, September 9, 2009
ArchJava: Connecting Architecture to Implementation
Making Memories (BA ch 4)
Wednesday, September 2, 2009
"4+1" View
Architecting for Scale (BA ch 3)
Sunday, August 30, 2009
Toward Boxology
A Tale of Two Systems (BA ch 2)
- Technical Debt - I like the concept. While I have never used this particular approach on any of my projects, I think it has potential.
- YAGNI - I see it all the time. Developers like to "over engineer" by nature. Yes, I understand that someday you may need it, but why not refactor the code when that day comes?
- Development Team Morale - I think organizations tend to underestimate the impact of morale on employee productivity and product quality. The relationship between architectural quality and morale is a two way street. A poor architecture leads to poor morale and poor morale leads to a poor architecture.
Understanding Quality Attributes (SAIP ch 4)
What is Architecture? (BA ch 1)
- On page 10, the authors claim that an architect's first concern is not the functionality of the system. Instead, it is the quality concerns that an architect should begin with. While I agree with this in principal, it is my experience that this is not typically the case. I wholeheartedly believe that a good architect should think this way. However, for every good architect I think there are tens (maybe hundreds? :)) of bad architects. Why is this? I think it stems from the fact of how architects are promoted within Corporate America. Typically, they are not necessarily the most skilled individuals on the project team ... just the ones who have been there the longest! Most either have no or very limited formal training on how to perform their jobs effectively. (Hmmm .... I wonder if this is how developers working on projects where I have served as the lead architect feel?!@?)
- Something that is not really discussed in much detail in the chapter which I feel is important is in regards to the cost-benefit trade offs of quality concerns. Does it cost more to build systems that are highly available, scalable, easy to test, have great performance, etc., etc.? I think that these systems definitely tend to be more complex, but it is not always easy to determine the impacts to costs or the monetized benefits of such a design. For example, people who wear suits like to perform cost benefit analysis exercises. For things like increases in performance, this may be fairly easy. With Architecture A, I can support Y transactions per second, but with architecture B that only costs me $1 more I can support Y+20 transactions per second which equates to $1 million / year in added sales. Yeah! But how do we quantify the realized benefits of a system that is highly scalable or easily modifiable?