difference between thread and process



Hi,

I'd like to understand what's the difference between a
thread and a process and how this is related to Java's
threading mechanism.

For example it used to be that, under Linux, every Java
thread would appear as a single process (using the 'ps'
command that reports a snapshot of the current
processes).

One thing that I particularly don't understand is the
following: the Thread class's stop() method is
deprecated. And, sure enough, I've been able to
write quite some amount of multi-threaded Java
code without ever needing to brutally 'stop' threads.

Why does Windows provides a TerminateProcess()
and Unix a kill() facility to terminate/kill processes?

Is it bad programming style to call TerminateProcess()
and kill() ? If not, would it be bad to have in Java
a "correct" way to kill a Thread ? (not stop(), which is
broken, but something else?)

What makes these processes so fundamentally different
than Java threads that it is possible to terminate/kill
them?

.



Relevant Pages

  • Re: pipe channel getting blocked on windows
    ... >the Win32 function TerminateProcessas some kill implementations are, ... > The TerminateProcess function is used to unconditionally cause a process to exit. ... , there's no true mapping for SIGKILL to an exceptional exitcode, but I ...
    (comp.lang.tcl)
  • Re: CreateProcess and TerminateProcess
    ... I want to kill a process that I created with CreateProces. ... So if the createprocess fails, you try to close a handle on an uninitialized variable ... Any program that contains a gratuitous TerminateProcess like this is deeply flawed. ... the application (which you can find by searching the top-level windows and finding the ...
    (microsoft.public.vc.mfc)
  • Re: Process.Kill() problem
    ... When Process.Killthrows the Win32Exception the NativeErrorCode ... When I use the alternative TerminateProcess() it just returns false ... iexplore.exe isn't what I need to kill anyways. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Kill a process through JAVA
    ... > How Can we kill an already running process through Java code? ... I have created an Application for Business Objects which in ... If you cannot kill the process using traditional M$-programming technics ...
    (comp.lang.java.help)
  • Re: Kill a process through JAVA
    ... destroy ust unconditionally ... through java u created "Application for Business Objects", ... > How Can we kill an already running process through Java code? ...
    (comp.lang.java.help)