On 9/15/06, haiyun wang <[EMAIL PROTECTED]> wrote:
Greg, Thanks. The reason I asked this question is: recently I have to convert a unix server into Java solution. My unix server has lots of processes communicated with each other through IPC(domain socket, shared memory) and uses socket to communicate on different machines. It seems that unix server is much easier to scale(there is a debate that process could be scaled better than thread). http://blog.labnotes.org/2006/08/29/why-processes-scale-better-than-threads/ And I can simply kill or start a unix process if one works abnormally. However, in Java, developers use multi-threads(unix also has multi-thread). I just wonder how java server could scale better(not the application server solution).
Generally speaking, and for recent JVM ( >= 1.4), they use native threads, ie system threads. One more question: When I start two Java processes on the same machine, they
work on DIFFERENT VM?
They are processes. Each process run on its own, it just shares the executable code whith another process which use the same program. You can kill a process without disturbing *at all* th other one. Be aware that sometime there is a father-son dependency, if the father forked the same process, so there might be clear dependence between them. btw, this is typically how unix works (I don't really know about W$, but I guess it does the same, because M$ didn't invented the OS concepts :), JVM are really not different from any other executable from this point of view. Emmanuel Lécharny
