ways for a process to end

  • Follow


Here are the ways I think a process can come to an end. Am I missing any?

1. Calling exit() (which eventually calls _exit()).

2. Returning from main(), which probably is just a variant of (1).

3. Terminating due to a signal.

4. Being overlaid with a new process image via the exec() family.

5. Power cord.

Anything else?

Thanks,
Mohun Biswas

0
Reply Mohun 10/7/2003 4:42:53 PM

In article <h2Cgb.425920$2x.146214@rwcrnsc52.ops.asp.att.net>,
Mohun Biswas  <m.biswas@invalid.addr> wrote:
>Here are the ways I think a process can come to an end. Am I missing any?
>
>1. Calling exit() (which eventually calls _exit()).
>
>2. Returning from main(), which probably is just a variant of (1).

Correct.

>3. Terminating due to a signal.
>
>4. Being overlaid with a new process image via the exec() family.

The process doesn't end when this happens, it just changes to running a
different program.

>5. Power cord.

>Anything else?

I can't think of any.

-- 
Barry Margolin, barry.margolin@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
0
Reply Barry 10/7/2003 4:48:42 PM


>>Here are the ways I think a process can come to an end. Am I missing any?

>>5. Power cord.

>>Anything else?

Gosh, if you're going to consider that, you might as well include:

6. OS kernel crash

7. uncorrectable RAM error (on some OSs this will kill only affected
processes).

8. End of Time.

I suppose a more interesting question might be what can end a process but
leave other processes running. Or in a network, what can end a process but
leave other machines running.

-- 
	mac the na�f
0
Reply Alex 10/7/2003 10:01:08 PM

Mohun Biswas <m.biswas@invalid.addr> wrote in message news:<h2Cgb.425920$2x.146214@rwcrnsc52.ops.asp.att.net>...
> Here are the ways I think a process can come to an end. Am I missing any?
> 
> 1. Calling exit() (which eventually calls _exit()).
....
> Anything else?

There are a couple more ways for the process to evaporate without
passing through libc.so`_exit(), if that's what you are asking:

6. syscall(SYS_exit, rc); 
   Could also be done in assembly; somewhat equivalent to 1.

7. pthread_exit(rc) or _lwp_exit(rc)
   That is, terminate the last kernel scheduling entity (aka kernel thread)
   for that process.

Cheers,
0
Reply ppluzhnikov 10/8/2003 12:36:33 AM

3 Replies
127 Views

(page loaded in 0.076 seconds)


Reply: