Anil Deshpande wrote:Am I right? Is it proper to compare the Threads of Java and Fork. Or is it like Apple to Orange comparison. I need some proper perspective about this.
I'd definitely look at Campbell's link, but the
functional difference is that what a Thread (or Runtime; and I'd advise you to use the latter) does is
independent of the Thread that spawned it.
In languages that implement
fork() in it's usual form, it spawns an identical process (of some kind, heavy- or lightweight) that
continues on from where the
fork() was encountered, usually with a copy of all the process state information at that time.
Java Threads, on the other hand, can process code that is entirely different from the Thread that spawned them, but what they
usually (and I say this because I'm NOT a Java multi-threading expert) share/clone is the
environment of the spawning Thread (current directory, critical variable states ... things like that).
As to details, you really do need to check the tutorials (or the JLS).
HIH
Winston