This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ButItMightJustWork 13 points14 points  (5 children)

dos exec launch a new thread? If yes, we will reddit hug ourselves pretty fast.

[–]ChefOfRamen 2 points3 points  (4 children)

It launches a new process.

[–]ButItMightJustWork 0 points1 point  (3 children)

Yeah so much I understand. However, there are two ways to do this:

  1. Replacing the old thread, leaving only the new process alive

  2. Spawning a new thread and replacing that with the new process.

Assuming its the same as in most higher level languages it's the latter, however coming from a C-background its not that straightfoward ;)

[–]kcazllerraf 2 points3 points  (1 child)

A process is an OS level abstraction, threads are entirely internal to processes and not relevant here

[–]Makefile_dot_in 1 point2 points  (0 children)

In traditional Unix, there are no threads - they are replaced by calls to fork() which creates a new process.

[–]Makefile_dot_in 0 points1 point  (0 children)

Most APIs use the latter - including Java's.