13 ms·
What Happens to OO When Processors Are Free? (2015)
- nowarninglabel 10y agoI guess to take this a bit further, the thought that came to mind for me is if we start processing every user on their own vm with own core and memory. Is that something anyone is doing today with web sites? It'd seemingly be horribly inefficient, but it's an interesting thought experiment.
- catern 10y agoYes, that's a fascinating new technique, known as "CGI scripting".
- masklinn 10y ago> Is that something anyone is doing today with web sites? It's a pretty common unikernel demo, see erlang on xen's "zerg" for instance: http://zerg.erlangonxen.org http://zerg.erlangonxen.org The Mirage project's Jitsu also does something similar (though not identical): https://github.com/mirage/jitsu https://github.com/mirage/jitsu
- abrookewood 10y agoIt's not that inefficient if you are not working with real 'VMs', but with containers (or something similar). The unikernel projects mentioned by the peer below (Ling, MirageOS) can spin up a container per request, respond and then tear it down in milliseconds. They are pretty interesting from a security perspective, especially when you couple them with a read-only image - I imagine it would be pretty hard to attack something that only persists for the time it takes to handle a single request. EDIT: Peer is below.
- icebraining 10y agoI imagine it would be pretty hard to attack something that only persists for the time it takes to handle a single request. I don't see why. If the request is the attack (as it usually is), then it'll persist for just long enough to accomplish it. What kind of attacks do you see it avoiding?
- mtrpcic 10y agoI think the big benefit is that it avoids attacks that infect the server, because in this case, the server is "destroyed" when the request finishes. So a request that would maliciously upload "hackertools.php" would be useless, because the host (read: container) that the file is uploaded to is not the web server, but the container.
- abrookewood 10y agoYes, this is what I meant. It doesn't make the server any less vulnerable to an individual attack, but it makes it very hard to escalate it. Though there was a really interesting video about a security guy breaking out of Lambda recently and uncovering a persistent file system somewhere - will try to find it. Edit: Found it: https://media.ccc.de/v/33c3-7865-gone_in_60_milliseconds https://media.ccc.de/v/33c3-7865-gone_in_60_milliseconds
- notamy 10y agoMinor nitpick: (2015) That aside, I wonder how hard proper software development would be for such a machine. It seems like multi-threaded software is something that we struggle to get right in our current low-core-count systems, so...
- rntz 10y agoMessage-oriented no-shared-state approaches (whether you call it Actors, objects, CSP, session types, or whatever) to concurrency have proved much easier to write correct software in than the traditional threads, locks, and shared memory approach. And it's the message-oriented approach that the article proposes basing the hardware design on.
- platz 10y agoYes but Erlang provides a run-time that manages the messages between the actors/objects. Where does the run-time exist in such a machine? Would even be possible to have a run-time given the processor units exist at the lowest level?
- masklinn 10y agoAssuming process residency/pinning and an erlang-like model it could be pretty easy. Multi-threading I think would be rather bad as you'd have a lot of churn trying to maintain cache coherency, at least at the higher end (hundreds+ cores). At 18 cores it's nothing out of the ordinary, Xeon E5 v4 (broadwell) top out at 22 cores + HT (so 44 threads), and Sun's Ultrasparc T2 topped out at 8C8T (64 concurrent threads). Though you'd probably want to read the old Connection Machine papers too, the CM1 had up to 65kCPU (although individual CM CPUs were much, much simpler than ARM cores).
- cjensen 10y agoThe notion that multi-threading is hard to get right is a common one, but it does not match my experience. I've been running 100+ threads in C++ routinely for 20 years now. So long as you are sensible (using mutexes for shared data structures, using queues or whatever for inter-thread messaging, using semaphores for inter-thread signaling, etc) it just isn't hard. The only thing that briefly got me in trouble was when I tried my hand at lock-free data structures. Once they are working, they are fine, but it takes a few surprises before you really understand the A-B-A problem.
- readams 10y agoThis sounds like a good idea until you realize that your computations will be dominated by synchronization and/or communication overhead.
- mpweiher 10y agoThe point of the article was that there is so much extra parallel horsepower available that you would come out ahead even if overhead is something staggeringly ridiculous like 100x. That's what makes the idea interesting (though obviously not necessarily correct, it's just a thought-experiment).
- njloof 10y agoTher Connection Machine was able to handle arbitrary n-processors-to-n-processors "sends" in (log2 n) time, but only by interconnecting the processors in a (log2 n)-dimensional hypercube. That's a lot of interconnects...
- dfox 10y agoAlso, Connection Machine does not have independent processors that execute arbitrary code and do uncoordinated communications. In traditional CM, everything happens synchronously under control of one global microcode sequencer, so communication can be planned by some offline algorithm that finds optimal paths for any given N to M communication operation. Also CM "processors" are not CPU's in any meaningful sense. Each CM's processor is essentially multiplexer and few bits of registers. Instruction is presented to the data inputs of multiplexer and processor state goes to the selection inputs with mux output being the next CPU state. In essence it's FPGA turned inside-out.
- elihu 10y agoSetting aside for a moment the wisdom of using thousands of cores to enable object oriented programming (which I'm dubious of), it seems to me that the way modern processors handle communication and synchronization is mostly a historical accident, and we could probably do a lot better than just letting processes share memory willy-nilly and having the processor cache sort it out. Like maybe we could give each core a set of registers dedicated explicitly for communicating with its neighbors, bypassing the memory hierarchy entirely for small messages.
- mmstick 10y agoNothing happens to object-oriented programming because it is entirely unrelated to multicore processors, except for the fact that object-oriented programming makes for terribly inefficient data structures that cannot handle threading very well. If you've written software before, you would know that most of your codepaths require prior data to be processed, and thus having multiple cores won't make software any faster than before. Additionally, there is a cost to starting threads, so the benefit of making your software multi-threaded has to outweigh the cost of launching a thread, sending data to that thread, and getting results from that thread. Pooling and channels are often used to mitigate the initial cost of creating threads, but it still remains that it takes time to send data to a thread and receive data from that thread, and there will always be that one main thread that needs to handle the majority of the logic and keep results in sync. Basically, it would be easier to see powerful cores sitting adjacent to miniature parallel cores that are able to respond quickly to requests.
- masklinn 10y ago> Nothing happens to object-oriented programming because it is entirely unrelated to multicore processors, except for the fact that object-oriented programming makes for terribly inefficient data structures that cannot handle threading very well. OO doesn't specify the data structures though, if you model your objects as shared-nothing message-oriented entities it does concurrency pretty well (by not doing threading at all).
- mpweiher 10y agoExactly. In fact, Alan Kay very specifically wrote his model was that of little computers talking to each other. Having heap-allocated chunks of memory multiplexed onto a single processor, whether sequentially or by time-sharing, is/was an implementation technique that was necessary because massively concurrent hardware wasn't possible at the time. The question is whether this is still true, and if it is not, what the consequences would be.
- jfoutz 10y agoI've been thinking about this a lot lately. I think we're hitting this point of objects as little computers with microservices.
- cjensen 10y agoHaving a dedicated processor for each object is a terrible idea in terms of energy. Consider current high-core count Intel processors on Windows. Windows shuts down entire cores to save energy. Windows only powers enough cores to cover your current workload plus some margin. I assume other OSs work the same. If each object has its own processor, then either (1) you must keep the core powered for the lifetime of the object or (2) the core must be energized each time the object receives a message, and re-energizing is not free. I guess if the core could auto-detect its load (as current Intel processors do) that would help. But I think dynamically shuttling threads between cores and shutting down as much as possible (which is exactly what Windows does) is likely to be much more efficient. So go ahead and have a thread-per-object for this hypothetical architecture, but let the OS decide when and where to assign cores.
- BuuQu9hu 10y agoYou don't want this at the object level anyway. You want to have objects clumped into vats, which are related object graphs that are isolated from other vats but freely intermingle otherwise. Then, messages between vats invoke turns of delivery inside vats independent of other vats, and we can schedule one vat per processor.
- neolefty 10y agoWhat if we separate this into two questions: (1) What if you have a fabric of "free" processors, and the real cost is energy? (2) How would <foo> programming paradigm work on this fabric?
- dorianm 10y agoDiscussion at the time it was posted: https://news.ycombinator.com/item?id=10121974 https://news.ycombinator.com/item?id=10121974 (linked by the author in 2015).
- dnautics 10y agoCommunications overhead will not scale and your parallelism will be amdahl's law-bound. You're better off being gustafson's law-bound, and to use those processors for running more copies of the single-threaded program with different values.
- crb002 10y agoQt added signals/slots to C++. FPGAs will get us most of the way there. We will want to express programs as concrete circuits and message passing. Something like http://www.clash-lang.org http://www.clash-lang.org . Stream level operations are preferred over "Object" messages. There is a tradeoff between large bandwidth large area circuits, and smaller circuits with less bandwidth. Inherently serial stuff goes on small circuits.
- gricardo99 10y agoRelated, there have in fact been fabricated arrays of processors, at least in Academia, for some time: http://vcl.ece.ucdavis.edu/pubs/2016.06.vlsi.symp.kiloCore/2016.vlsi.symp.kiloCore.pdf http://vcl.ece.ucdavis.edu/pubs/2016.06.vlsi.symp.kiloCore/2...
- chris_st 10y agoSlightly related is the video game "TIS-100"[1] which has you programming (incredibly) constrained processors that are arranged in a grid, with communication between them. The programming puzzles are not very difficult (so far! I'm about halfway through) and pretty entertaining to puzzle out. There's a "meta game" of comments by "your uncle" who was trying to get it working again. I think it's closer to the GreenArrays, Inc chips, really. [1] http://www.zachtronics.com/tis-100/ http://www.zachtronics.com/tis-100/
- agumonkey 10y agoThere's a talk by moore on infoq about the ga-144. It's as exciting as a CPU talk can be.
- agumonkey 10y agoThere's a talk by moore on infoq about the ga-144. It's as exciting as a CPU talk can be.
- abrookewood 10y agoIt's a lot harder when you realise that everyone is trying to optimise for Cycle count, rather than the number of Instructions/Nodes.
- stcredzero 10y agoIt's not the cost of processing that holds us back so much as it's the cost of coordinating. Doing things in parallel and concurrently are where things get tricky. So an opportunity to trade off software complexity for transistors is interesting, of course!
- Animats 10y agoThe real question is "what do we do with a lot of CPUs without shared memory?" Such hardware has been built many times - Thinking Machines, Ncube, the PS2's Cell - and has not been too useful for general purpose computing. One of the simplest cases for broad parallelism is search where most of the searches fail. The required intercommunication bandwidth is low - you start up all the machines and wait for somebody to report success. Bitcoin miners and crypto key searchers are extreme examples. Problems which can be hammered into that form parallelize well. Some problems that distribute spatially parallelize well on such hardware. Weather prediction, wind tunnel simulation, nuclear explosion simulation - hydrodynamics problems like that can be handled in sections, with communications only for the edge elements. That's what supercomputers are used for. Neural nets and deep learning, though - finally, there's a broad use case for such architectures. Google is using lots of GPU-type boards that way now. This is a key concept. Massive parallelism on a single problem is really hard to apply to the things people used to do on computers. Instead, it makes possible new things to do. An important question is how much memory each CPU should have. Thinking Machines, NCube, and the Cell (256K each) clearly had too little. You need enough memory per CPU that the intercommunication doesn't dominate the problem. The other big problem is how to organize software for this. We have two main models of parallel software - shared memory, and clusters on a network. Those are the two extremes for parallelism. Systems where the CPUs are more tightly coupled than in an cluster but less tightly coupled than in a shared memory multiprocessor fall outside common programming paradigms. This is a very hard problem, with no really good general-purpose solutions.
- highd 10y agoOne interesting thing going forward (over the next decade) regarding deep learning and high-performance computing will be if we can circumvent the big serial bottleneck - that is, depth. The best benchmarks have generally all been set by networks with significantly increased levels of depth compared to the previous records. Gradient descent, however, requires propagating residuals back through every layer of the network (to tune the lowest layers, at any rate). This is inherently a serial task. Recurrent networks can be considered to be infinitely deep - in practice they're truncated to some finite level during training. There are a couple of solutions to these problems that are being worked on - including various "learning-to-learn" approaches. One approach (DeepMind published, I believe) is to locally train an auxiliary network to predict the back-propagated residuals coming down from the top. It will be interesting to see if these approaches pan out, or if eventually we start to run into real serial bottlenecks again as we build ever-deeper networks.
- sklivvz1971 10y agoThis article relies on the assumption that OO has been designed to work with single core or "few" core processor. It's a false assumption. OO has been designed to model the world in the hope that this would make expressing business logic easier. It's not hard to imagine what would happen with these many cores, because we already have specialized systems with many cores: GPUs and CUDA. And as every single time people talk about parallelism as a holy grail of performance, the truth is obvious to whomever actually uses this hardware: not many problems are highly parallelizable and parallelism is always harder than single threaded code -- it's harder to think about, and this has nothing to do with the programming paradigm.
- mikekchar 10y agoIt think you are incorrect in your last statement. All functors are inherently parallelisable. This means that any map operation is parallelisable. Also as long as the operations are associative (which is a surprisingly large number of cases), your reduce operations will also be parallelisable. That means that any computation that can be represented by a map/reduce is usually fully parallelisable and always paralellisable in the map operation. The only operations that aren't paralellisable are those that depend on the previous values (and even then you can make judicious use of partial function application to cut down on the dependencies). Basically this is where you have effects where order matters and recursive calls. I think the main reason we have difficulty imagining massively parallel computing systems is that we hold onto mutable state and imperative syntax. This pretty much forces us into a situation where order is significant. It seems to me that abandoning that idea is the key to freeing ourselves up, programming-wise. Personally, I don't find pure fp, or immutable OO that much harder than imperative. Different, for sure, but both have advantages and disadvantages.
- dagss 10y agoNo. As someone who has spent five years programming computing clusters, I have seen many problems that are fundamentally hard to parallelize. If it falls within mapreduce you are basically "done" no matter what language you use (no need to argue fp vs imperative) but very many interesting problems to solve doesn't. I am a big believer in FP too, but for other reasons.
- digi_owl 10y agoThe whole thing brings to mind the hermetic expression, "as above, so below". It feels like every layers of computation logic ends up mimicking both higher and lower layers.
- markhahn 10y agoconfuses throughput with latency. has nothing to do with OO.