4 ms·
Ok, suppressing my first impulse to shout "bullshit", so just asking: how is Java making threads expensive? Because of the startup time of the virtual machine?
by Tichy 19y ago
Ok, suppressing my first impulse to shout "bullshit", so just asking: how is Java making threads expensive? Because of the startup time of the virtual machine? That is hardly a Java thing, it is a problem that is shared with scripting languages and other languages that are running on a virtual machine. Within Java threads are dead easy, though. Not as easy as in Erlang, but to be honest, it is very rare that Multithreading becomes necessary in a web application anyway.
Second, how do processes help writing web applications? I don't think he understood what frameworks are made for. Not saying that some Java frameworks are not bloated. Most frameworks I know also have only one hook, the method that has been mapped by the routing. What alternative to the "hook approach" does he suggest? What is the essence of the article, except "different is better", without saying how "different" would look like?
Back to the "expensive threads" issue: maybe it is an issue if you want to run CGI scripts from Apache. If you run scripts from a server written in Java, it is not an issue, because the JVM is already running.
- st3fan 19y ago"""Because of the startup time of the virtual machine?""" Fact is, we have hundreds of JVMs running that have uptimes of months. So really, we don't care about a JVM and app server starting up in 15 seconds. That is short term thinking. I'm rather fond of the long term stability though :)
- LogicHoleFlaw 19y agoI believe his point is that the cheap buildup/teardown of processes is inherently safer and more mature than a monolithic clump of threads in terms of isolating processes and ensuring resource deallocation. The startup time of the VM is a red herring in this case. I too have seen impressive VM uptimes. Almost as good as the OS uptimes I've seen. Java threads are dead easy as threads go. However, I don't believe that they're going to be a sustainable solution as we move forward. As processor counts keep rising and the focus moves from scaling up to scaling out we need to find more easily understood and debuggable abstractions for dealing with a massively parallel world.