4 ms·
"The first are the cogs. These are typically either immutable data structures, or mutable components designed to be accessed only from a single thread. The seco
by fmstephe 15y ago
"The first are the cogs. These are typically either immutable data structures, or mutable components designed to be accessed only from a single thread. The second is a concurrent abstraction which sits on top of the cogs."
This is a very good illustration of how concurrency potentially leaks out across an entire application. You can see here that your concerns for concurrency appears in the cogs. It is certainly true that you have provided a layer of abstraction but only for a certain concurrency model, and your cogs will reflect that in their implementation.
I would also note that I wouldn't claim that all concurrency problems pose these kinds of problem. Graphics pipelines being the easiest (and best abstracted) example. But in general for the day to day code we write, concurrency concerns have a habit of being very hard to tidy away.
For a really good treatment on the virtues and limitations of transactional memory there is a great conversation between Rich Hickey and Cliff Click on the clojure mailing list. I can't find the original, but here is a good cleaned up summary of the exchange.
http://blogs.azulsystems.com.sharedcopy.com/cliff/2008/05/97fd3e9e643ee6fa1009713c970381d7.html http://blogs.azulsystems.com.sharedcopy.com/cliff/2008/05/97...
- yummyfajitas 15y agoConcurrency does leak out and influence design decisions, most notably the API of the rest of the app. This is a given and there is nothing to be done about it. But the point I'm making is that once the API is fixed you get to program more or less normally. Look at the code I linked to - it's all standard procedural java. Some smart guys at Facebook developed the concurrency system. I did some ordinary programming subject to one additional constraint (immutability). I imagine this is how the future will look - top programmers build APIs, and the army of programmers will build many immutable/transactional/etc subcomponents. With language support (such as what Haskell/Clojure already give you) this will be very easy to enforce - IBM's army of guys who can't handle concurrency will stick to writing pure functions.
- vajrabum 15y agoYes, and the way I understood the article is that the problem--not for the next generation of chips but two generations down the line--is that cog architecture scales up to 10s or 100s of processors but not thousands due to synchronization delay. That I believe is what David Ungar is attempting to address in his research.
- swah 15y agoThanks guys, this kind of discussion is why I open HN every day for the past few years.