When a process creates a new process using the fork() operation, which of the following resources is available for read/write between the parent process and the child process?
a) stack
b) heap
c) shared memory segments.
Please explain the answer fully and also explain why the other 2 options are incorrect.
Child and parent run concurrently, parent may create another process and child may also create another porcess. To maintain child process separate stack is maintained by parent and child.
When child process is created, the copy of heap is shared. When a child process performs write on heap, the copy is private to child process. That is not visible to parent process.
When parent process makes some changes , private copy is maintained by parent process and not visible to child process.
Answer is option c
When a process creates a new process using the fork() operation, which of the following resources is available for read/...
Which of the following statements is true regarding the different memory segments for a process and its child process (created using the fork() system call)? 1. Text segment is shared. Data, heap and stack are not shared. 2. Text and data are shared. Heap and stack are not shared. 3. All are shared. 4. None are shared.
Write a program in C using the fork() system call to do the following. The parent process (main program) forks a process (CHILD 1) to compute and print the sum of first n integers where n is a variable shared between the parent and CHILD 1. It also forks another process (CHILD 2) that finds the sum of squares of the first n numbers where n is a variable it shares with the parent. Let CHILD 1 print “The sum...
GIVEN CODE- FILL IN THE
BLANK!
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
// Function ptototypes
int readX();
void writeX(int);
int main() /// chi read x ---> divi ---> write x into file
---> par read x --> sub--> write x into file---> chi
read x-->etc
{
int pid;
// pid: used to keep track of the child
process
int x = 19530; // x:
our value as integer
...
10) Unlike a signal, which conveys only the occurrence of a particular event and contains no information content, a pipe can be thought of as a scratch file created by a system call. It can be used as a communications channel between concurrently running processes. The interface call to a pipe is similar to that for any file. In fact, the process reads and writes to a pipe just like any file. Unlike files, however, pipes do not represent actual...
This is for a Unix class.
Please help me out.
I am attaching a skeletal code of the program below, it just
needs ti be filled in.
Below is a skeletal code of the program. Fork a child process and then use the
parent for reading and the child for writing. This is
just a way of sending and receiving messages
asynchronously.
/*
*************************************************************
* Utility functions
* **************************************************************
*/
static void
usageError(const char * progName, const char *msg)
{...
Consider a VEX-executing VLIW machine with the following characteristics: The machine supports 4 slots (4-wide machine) with the following resources: 2 memory units each with a load latency of 3 cycles 2 integer-add/sub functional units with a latency of 2 cycle 1 integer-multiply functional unit with a latency of 4 cycles Each functional unit in the machine is pipelined and can be issued a new operation at each cycle. However, the results of an operation are only available after the...
1. List some of the various communities to which you belong (organizations, work, hobbies, fields of expertise, family). Give examples of some of the behavioral and language characteristics particular to each group? For instance, do you speak to your job supervisor in the same way you speak to your child or your best friend? Why might you interact with members of different communities differently? 2.What are some of your past experiences with writing? Please explain what you like and...
TRUE/FALSE QUESTIONS: Foundations of Information Security and Assurance 1. There is a problem anticipating and testing for all potential types of non-standard inputs that might be exploited by an attacker to subvert a program. 2. Without suitable synchronization of accesses it is possible that values may be corrupted, or changes lost, due to over-lapping access, use, and replacement of shared values. 3. The biggest change of the nature in Windows XP SP2 was to change all anonymous remote procedure call (RPC)...
Have you ever considered how we come to understand the world around us? Think about that question for a minute. What is science, and how do we use it to solve real-world problems? In our first discussion, I want to delve into thinking about the nature of biology. This includes what it is, the major themes, and how we come to form claims or knowledge. You should spend approximately 3 hours on this assignment. Instructions Use the text readings and...
Please read the following article: Your Google Searches Could Help the FDA Find Drug Side Effects The Food and Drug Administration is talking to Google about how the search engine could help the agency identify previously unknown side effects of medications. Agency officials held a conference call on June 9 with a senior Google researcher who co-wrote a 2013 paper about using search query data to identify adverse drug reactions, according to a record of the meeting posted to the...