Mark Russinovich: Inside Windows 7
2) Mash-Ups as a good conceptual model for programming coordinating systems (well, Mash-Ups that are able to communicate across constituent boundaries...)
I think these are very important concepts that deserve some more discussion and thought.
Coordinatingly,
C
Great talk guys! Really hits the core of many things here.
1) Concurrency happens.
Having used the CCR, I understand what G. is saying here. Once your system is factored with ccr-"agents" this way and the message passing boundaries are defined with Ports, then your Agent "hides" and handles its own state - so it is more naturally composable
in many respects. This is similar to what Eric has been saying with Functions. Functions can safely run in parallel because they are self contained and don't modify external state - they get an input and return an output. A CCR service does not have this strong
of a contract. The programmer can make it unsafe, but if you follow some patterns, it makes it far more approachable to do things correctly. I think what he is saying is you *have to have coordination and correctness *first. Once you have that, concurrency
can then happen correctly, because the model is correct. Then you can dump 1000 cores at it, and it does not matter, because your correct and scaling can just happen. That said, the model needs to raise another level of abstraction to make it Correct-by-Contruction
because it is still too easy to do it wrong or just not "see" a race or a fifo logic error. But I think projects like Maestro are addressing this area with compiler/language to support the Model.
2) Mash-ups.
This is a good analogy for web devs. Other folks may find SOA or just Services a better analogy. I think Hue(?) from a WCF video said "Every object should be a service". He was right, the model has to change. I don't think we need every object a service, but
we need to be able to draw a circle around N objects and define the service boundary. It makes it very clean because it does not matter if service is remote, in-proc, or out-of-proc. The model is the same in all cases.
3) Is it difficult?
IMO, I don't think it is. It is different, but don't think it any harder then hooking up events. You have to think about Joins and stuff, but you will end up doing that anyway using more difficult patterns (locks, Reset Events, etc). IMO, the Port abstraction
makes it easier to reason about your services and makes the boundaries explicit and loose. I think the issue people may be having is not thinking about using CCR model as a Whole application model. They are thinking only about making a specific thing concurrent.
When you do this, you end up trying to "wrap"/abstract the Port/Handler model instead of exposing it to other parts of your program. This means you can spend time doing the wrong thing - turning your async Port abstraction back into a sync method call - which
is counter to the service idea. You need to embrase the Port abstraction in your Whole program. Make services and make it composable. You can then version easily, drop/restart services dynamically, Pipelining becomes easy, can also refactor services as needed
on onto different machines.
4) Take it to the extreme.
Lets say in a new world, everything is surfaced as a ccr Port. Files are "Ports", serial Ports, usb Ports, keyboard Ports, Scanner Ports, video Port, the UI is a Port, etc.
Everything has a Port abstraction and you have *ONE model to program against everything and coordinate everything. That is a powerful model. And it is not sci-fi, you could do this today yourself with your own Port wrappers. Things like the Windows POS library
should be Port based as well.
--William
Will the Robotic Developer Studio 2008 by available with a MSDN subscription? We can download versions 1.0 and 1.5 now.