Pat Farrell wrote:
I've been writing for a while that Java's multi-thread support is too hard to implement. Its OK for a simple UI thread and background worker, but it doesn't scale to use all the cores in a modern computer system.
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Henry Wong wrote:what do you mean by "doesn't scale"? You have mentioned this in the past, and I always understood it as it gets really complicated -- which I don't really agree with, but understand the issues.
With this post, however, you are implying that you can't keep the processors busy. In that regard, I completely and totally disagree. Multi-core processors may be coming online in the personal computer market, but they have been available for a very long time. Even as early as last year, you can get a JVM running on hardware with over 800 processor cores
Bert Bates wrote:Yet another technology mismatch. It would seem the hardware guys are ahead of the software guys. Is it possible that we just haven't come up with a software metaphor for parallel processing that's widely grasp-able by human brains?
Pat Farrell wrote:
You have what I mean by "scale" right. Things like the Azul 800+ core processors are very cool. But I believe that taking a standard Java app written by most of the programmers on sites like this, and I think we are smarter than the average bears, are just not going to keep dozens of cores working.
Pat Farrell wrote:
There are really two very different kinds of scaling. One is supporting a massive commercial website. Say Squarespace (which I hear is in Scala). There are millions of hits per day, and the servlet container can spawn off hundreds of thousands of threads to process it. There is actually not a lot of parallel processing in them.
The second is dealing with large sets of data, processing complex algorithms against it. What you want to do here is partition the data and algorithm and spray them to hundreds if not thousands of essentially identical portions. Not SIMD parallel, but real parallel. You have to partition the data, synchronize across the work units, transfer data between processors, do the next step, etc.
Henry Wong wrote:Well, now I am not sure of what you are saying... If you are saying that it is hard to get an average program running with dozens of processors, I only mildly disagree. I don't completely agree, but don't disagree either.
If you are saying that you can't get anything to scale, then I completely disagree.
Pat Farrell wrote:
There are really, really hard problems getting access to "main memory" from lots of cores, and most solutions lead to serious cache coherency issues. But for sure, the hardware folks are ahead of software folks like us.
Pat Farrell wrote:What you want to do here is partition the data and algorithm and spray them to hundreds if not thousands of essentially identical portions. Not SIMD parallel, but real parallel. You have to partition the data, synchronize across the work units, transfer data between processors, do the next step, etc.
Pat Farrell wrote:
I'm not saying that really smart, dedicated folks can't make anything scale. They can do anything. I'm concerned about the 80% of folks who are not really smart, dedicated, motivated and hard working.
What I am saying is that it is way too hard for the average professional programmer. You have to break the algorithms into thread pools and manage them. Sure, I bought the first edition of @Henry's book, and have been using it ever since. It can be done. And its easier with later JDK support. But its still based on very simple primitives that require the programmer to understand how all the sharing works. And when the programmer forgets something, you get subtle race conditions that can be nearly impossible to replicate and eradicate.
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Pat Farrell wrote:I'm not saying that really smart, dedicated folks can't make anything scale. They can do anything. I'm concerned about the 80% of folks who are not really smart, dedicated, motivated and hard working.
Paul Clapham wrote:Unfortunately what I'm describing here is a thorough overhaul of Java. That's something which I don't think has ever been done in the history of programming languages. And I don't see anybody, or at least not anybody with sufficient drive, who would be willing to attempt that fork.
Henry Wong wrote: And quite frankly, I think that you are being very generous with the 80% remark. Even a lot of very smart people that I know, have issues thinking concurrently.
Henry Wong wrote:The issue was with the premise. The premise is that Java won't scale, and hence, is doomed. If the premise was Java is very difficult to scale, and hence, will have issues in the future, then I would not have disagreed (at least, not as strong as I did).
Pat Farrell wrote:
I was durn'd good with Macro Assembly in the olden days. But those times have passed. By the 80s, the claim that you had to write in assembly/macro to get speed was starting to crack, in the 90s it was blown up. Delayed branch, speculative execution, etc made it so that you had to have the compiler do the optimization. We are at a similar turning point today. Soon cell phones will be having quad core processors. I'm sure that my next desktop will have 16 or 32 cores.
Henry Wong wrote:My multiprocessor days goes back to the early 90's, so I have seen this "turning point" argument many times before.
From the "parallelizing compilers", of the early 90s, which is supposed to take threading concerns from the programmer completely -- just code like its a fast single processor and the compiler will take care of it. To the object oriented approach of the mid 90s, which is supposed to make it easy. In fact, that was one of the selling points of Java. To the frameworks, like servlets, EJBs, and web services, that is supposed to take care of everything. And all you have to do is code single threaded for one transaction. To these modern frameworks and languages that is supposed to ... etc. etc. etc
William Brogden wrote:Seems to me the real successful approach to using multiple cores would be closer to Grid computing and Map-Reduce where you dont really expect shared memory but use reallllly fast message passing.
Somewhere around here I have a Transputer chip-set - what we hoped would solve the multi core problem back in the 80s. OCCAM was the language required to make full use of it - how time flies.
Paul Clapham wrote:
Pat Farrell wrote:I'm not saying that really smart, dedicated folks can't make anything scale. They can do anything. I'm concerned about the 80% of folks who are not really smart, dedicated, motivated and hard working.
That's why those 20% wrote the database servers and the web application servers and the object-relational-mapping systems, so that the 80% don't continually have to reinvent those wheels. And from the threading point of view, that's why the java.util.concurrent package exists -- so the 80% don't have to continually blunder through the wait-notify jungle.
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Martijn Verburg wrote:Some of new Java 7 features (such as NIO.2) are trying to keep up with Hardware/Software advances, could be worth checking out!
Pat Farrell wrote:
1) Javascript is functional, not OO
2) you can do OO style things if you want, but it has no inheritance.
Pat Farrell wrote:
For years, the cross-browser incompatibilities cause me to run away whenever Javascript is mentioned, but some smart folks are saying that Javascript is a viable language for server side stuff. Sounds far out to me, but I'm willing to listen to the arguments.
David Newton wrote:JavaScript *IS* OO, and I don't understand why anyone ever claims otherwise. Just because it's not class-based doesn't mean it's not OO, nor that it doesn't have inheritance--just not the same kind. (And it's only "functional" in the sense that functions are first-order objects, which is a subset of functional languages.)
David Newton wrote:How did this thread turn to JavaScript?
Pat Farrell wrote:Real Soon Now. or not.
I've been writing for a while that Java's multi-thread support is too hard to implement.
...
Debbie Waltz wrote:For what it matters, it is far simpler than doing it in C/C++.....have a look at Van Roy's Programming Paradigms for Dummies.
Pat Farrell wrote:how Javascript does closures is sure foreign to my brain.
Pat Farrell wrote:I think you may be on to something. All programming since Lady Lovelace has been sequential. Its how we think. And we need to stop that. Humans actually do a lot of parallel processing, vision is massively parallel. Hearing music is parallel.
João Bispo wrote:
Pat Farrell wrote:I think you may be on to something. All programming since Lady Lovelace has been sequential. Its how we think. And we need to stop that. Humans actually do a lot of parallel processing, vision is massively parallel. Hearing music is parallel.
The brain works as a massive parallel processor, but our mind, on top of that "parallel hardware", is mostly sequential. We will not stop thinking "sequential".
Many-core will hardly be the answer for the future of programming. Companies will not admit it, but they are already looking into heterogeneous systems.
Future Microprocessors: Multi-core, Mega-nonsense, and What We Must Do Differently Moving Forward
Pat Farrell wrote:
Frameworks like EJB are demon spawn. Not nice Daemon, but evil smoking, acid tongue, fire breathing demons. WSDL is another crock. As is RMI and applets.
Raul Guerrero wrote:we are only able to use between 5-15% of our "hardware" capacity at most
Ajeeth Kumar wrote:Seriously guys... i hate java... i dont know why i am even here... I have worked in java for 6 yrs now and I can never say confidently that i know java.. cos the documentation sucks...I find writing "printf" easier than "S.o.p".... and c'mon, cant Sun come up with meaningful examples in their javadocs like MSDN?? I have to spend hours to understand "reflections" from the blogs, articles on the net whereas it can be put in a simple way with some simple examples just like MSDN.
SCJP
Visit my download page
There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|