answersLogoWhite

0


Best Answer

A parent process is a process that has spawned one or more child processes such that it takes "ownership" of those processes.

A foreground process typically means a process that has a user-interface as opposed to a background process which typically does not. Most background processes are services while most foreground processes are applications.

It's important to note that the term "process" has a specific meaning in a multi-processing environment. A process is a computer program that has one or more threads of execution. A thread is the machine-level representation of a task and a process may instantiate as many tasks as are required (hardware permitting). All tasks share the same memory space as the process itself, however each task has its own stack for local storage, as well as to enable the thread's function call-and-return mechanism in addition to thread-local exception handling.

Every process must have at least one thread of execution typically referred to as the main thread because that is the thread that executes the program's global main function (the entry point of the application) and subsequently instantiates any additional threads required by the main thread. The additional threads are usually called worker threads and any thread can instantiate its own worker threads. Unlike parent/child processes, thread's cannot "own" other threads; the threads are owned by the process. However, it is possible for worker threads to be controlled by other threads in the same process, so in that sense the controlling thread can be said to be a parent thread.

When the main function returns, the main thread terminates, however any active threads within the process will continue executing, thus keeping the process "alive". In many cases this would be undesirable particularly if those threads attempt to access shared memory that is released by the main thread. So although there is no notion of ownership amongst threads, any controlling thread that must terminate before its workers have completed their tasks should signal its workers to terminate and then wait for them to terminate before terminating itself.

Threads of execution within a process execute concurrently. All this means is that the operating system's task scheduler gives each thread a time-slice of the CPU to do some work, before saving the thread's state and moving onto the next thread (which may belong to another process entirely). Task-switching is so rapid that it can appear as though all threads are executing simultaneously, however that is only physically possible when the CPU has 2 or more cores available. Only one thread may execute upon any single core at any given moment.

Multiple threads are typically used to maintain responsiveness. In a GUI environment, a time-consuming task would take up the entire time-slice of a process so it won't be able to respond to any messages on the message queue unless the task specifically checks the queue periodically. However, by using a worker thread to carry out the task, the controlling thread can remain responsive to messages. The message queue can also be used by threads to signal other threads, thus a controlling thread can respond to periodic progress reports from its worker threads if required. In this sense it can be said that the worker threads are background tasks, while the controlling thread is the foreground task.

User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between a Parent Process and Foreground Process?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

When a process creates a new process using what state is shared between the parent process and the child process?

shared memory segment


What is a fork in computer programming?

Fork() is a concept that originated in the UNIX world. Running programs are called processes, and the only way to execute a new program is for a current program to fork() itself, thereby creating a separate process. The process that called fork() is known as the parent process, and the newly created process is known as the child process. The child process, which begins its life as a copy of the parent process, can be "replaced". In UNIX, the first program that is executed after booting finishes is the init process. This process will fork() and load the getty program over the child process, thereby creating a process which will prompt the user for a password. Since a call to fork() creates a child process which is in essence the same as the parent process, it is necessary to determine (from within the process) which process is the child, and which is the parent. Upon successful execution, the fork() call returns the child's Process ID in the parent process, and a 0 in the child process. You can then use the child to execute a system call, such as running another program (or whatever you needed a second process for). If you are using pipes (for communication between the child and parent process), make sure you have the parent wait for it. --- In open source programming, a fork is a separate project that starts as a copy of another one. If the developers have it out with one another, or a developer wants to take the project in a different direction, then they copy the source code to a new repository and work on it there, completely separate from the original project.


What is the difference between processes and threads?

The memory space, where a given application is executed is called - process. A Process is the memory set aside for an application to be executed in. Within this process the thing, which is really executed is the thread. The key difference is that processes are fully isolated from each other; threads share (heap) memory with other threads running in the same application. Threads share the address space of the process that created it; processes have their own address. Threads have direct access to the data segment of its process; processes have their own copy of the data segment of the parent process. Threads can directly communicate with other threads of its process; processes must use inter-process communication to communicate with sibling processes. Threads have almost no overhead; processes have considerable overhead. New threads are easily created; new processes require duplication of the parent process. Threads can exercise considerable control over threads of the same process; processes can only exercise control over child processes. A great answer to the question can also be found here: (link moved to link section)


What is the difference between welding of metals and plastics?

because of the difference in physical characteristics of thermoplastics and metals, there are corresponding differences between welding techniques for metals and thermo-plastics. in the welding of metal, welding rod and parent material become molten and fuse into the required bond to form welded joints. this is not in thermo plastics, because they are poor heat conductors , they are difficult to heat uniformly .. so diifferent methods are used to weld plastics...


What is the difference between tree search and graph search?

A graph is a set of vertices which are connected to each other via a set of edges. A tree is a special type of hierarchical graph in which each node may have exactly one "parent" node and any number of "child" nodes, where a parent node is one level closer to the root and a child node is one level further away from the root.

Related questions

Difference between parent process and child process?

fork gives a 0 value for child process and non zero for parent process


What is the difference between a biological and a adoptive parent?

The difference between a biological parent and an adoptive parent is that the biological parent is the one who is related to the child by blood and the adoptive parent is the one that raised the child.


What is the difference between a child and their parent?

your parent is a grown up as if you are a baby


Difference between child process and threads in operating systems?

In operating systems, a child process is a new process created by an existing process, which operates independently and has its own memory space. Whereas a thread is a subset of a process, sharing the same memory space and resources as the parent process. Threads are lighter weight and more efficient compared to processes in terms of resource utilization.


What is the difference between a parent element and a daughter element?

biology


What is the difference between consolidated and parent entities?

The main difference between consolidated and parent entities is that consolidated financial statements show the activities of the parent company and all of its subsidiaries. A stand alone, or parent financial statement, treats each subsidiary as a a separate entity.


What is the difference between a biological parent and non custodial parent?

None, as both are usually biological parents.


When a process creates a new process using what state is shared between the parent process and the child process?

shared memory segment


What is the difference between a surrogate parent and a step parent?

A step parent has to be married to the husband, but a sur rogate only carries the baby for a unfortunate couple.


What are child and parent processes?

A child process is a process that was created by a parent process. The child process usually helps the parent process accomplish some task independently of the parent.


What are the different between single parent and parent?

They kind of mean the same thing but the difference is that : Single parent = A parent who is doing everything by her/his self like raising a family or handling children on his/her own. Parent = A parent is just everything. A parent is just a parent.


What is the difference between parent and parents?

A parent could be a divorced mom or dad that is single and parents are a mom and a dad. so pretty much parents is plural for parent.