Is the variable between the child process created by the fork() function and the parent process a critical resource? - operating-system

I have a question about OS.
Is the variable with the same name between the child process created by the fork() function and the parent process a critical resource?
I think the child process and the parent process can access variables with the same name at the same time, so it should not be considered a critical resource. And when the child process modifies the variable, it will copy a new variable.
Am I thinking right, thanks for your help!

Related

How to identify the multi-instance sub-process and differentiate it from the main process in Jbpm?

I have used one multi instance subprocess which includes an workflow with human task. When executing, its creating the number of human tasks as to the number of elements present inside the collection object. But all tasks have same process instance id. How the relation is working between parent process and multi instance subprocess?
If there are multiple elements in collection list, then it will create those many tasks inside the multi instance sub process. As all the tasks have same process instance id, how to identify the respective process variable values for each task and the uniqueness of each flow afterwards? And is there a way to make it create an different instance id for each task of the multi instance subprocess?
I did not get all the question, but I will try to answer what I got:
Human tasks have their own task instance id
What is collection object? If you mean tasks in bpmn model, then it is as expected: process instance flow starts after start node and when it reaches a human task, it will create an task instance with id. You can see it in the tasks in UI and with api you can claim, work on, complete , populate data etc.
it is wise to have a separate/different variable for every tasks that can execute in parallel. Then the input will be kept in distinguished data placeholders and you can use it accordingly.
you can create a different instance(task instance) for each task or have repeatable tasks
well the answer was to put the multi-instance into a sub-process, this will allow me to have a separate process instance id per each element of the my List (the input of the multi-instance )

Set Permissions on Folder without Processing Sub Files and Folders

I have two related issues that I am trying to solve. I want to update an ACL on a folder without it processing all of the children. My first example is when setting "This folder only" on a high level file, setting the permissions takes forever because it processes all of the children. The second example is that I have a file system were Everyone is directly applied to each item and I need to remove the entry without taking the time to process the children. I have used Get/Set-ACL and Get/Remove/Add-NTFSAccess, but cannot figure out how to stop the processing of the children objects.
NTFS inheritance is similar to genetic inheritance. As we, as children, get to blame our parents for all our faults whether they like it or not, child objects decide whether they inherit permissions from parent objects.
You cannot, using NTFS, change a permission on a parent object and tell it not to allow propagation to child objects.

In MDriven Enterprise Information, why is there a Processes Hierarchy and also a Processes Tree?

In MDriven Enterprise Information, why is there a Processes Hierarchy and also a Processes Tree? Aren’t they the same thing? Is this not redundant duplication?
Processes are defined by their steps.
A Process step can make use of another processes - ie defining a sub-process.
To both have the complete list of processes and the resulting expanded tree of process and their sub-processes and even their sub-processes (infinity) we added two nodes.
First node is the complete straight list of existing processes regardless if they are sub-processes or not.
Second node is the constructed tree of whom uses who - and a sub-process can then show up multiple times in this tree.
Notice that ApproveNewBulk is re-used in 2 processes in the example below.

os161 parent and child thread pid

Is anyone familiar with os/161 and can answer a few questions for me?
How exactly does child pid, parent pid works.
I know that when you call thread_fork() you are creating another thread base on the current thread, the new thread should have a unique id for himself and a different file descriptor table. While sys_fork create a child from curthread, the child is the same as the parent besides the pid. But I am confused in how pid and parent pid works.
This is my interpretation of the process table. There is only one process table for the whole system. For now I have parent_pid and my_pid for every thread.
-A parent thread can have multiple child, (by keep calling sys_fork).
-A child can only have one parent.
-Whenever sys_fork is called, a child is created and the parent_pid for this child is set to the pid of the thread who created this child.
-pid of 1 is for the boot/menu thread.
Am I even on the right track in understanding how process table works?
One last question:
For sys_waitpid(): Only parent can use waitpid? and they can only wait on their childs? Can a child use waitpid on a parent (or would this result in deadlock)?
I been searching around with Google, but I find so many contradictions, up till now I still can't find a clear answer to my questions.
I know nothing of OS/161 -- but your description sounds a lot like a standard POSIX system. So, here's how your questions work with POSIX and hopefully they'll make sense for OS/161 as well.
Only parents ever call waitpid(). Applications are designed around this. The POSIX specification of waitpid() requires returning an error with errno set to ECHILD if the pid is not a child of the calling process.
Children can determine if their parent has died by checking their own parent pid: getppid(3). If it is 1, then their parent has died and their parent has been set to init. (init is prepared to reap all orphaned children when they die, so the process state doesn't linger and fill the system process table with zombie processes.) (Modern systems don't have a "process table" any longer, but the pids must be recycled and some process control information must remain in the kernel until wait() of some sort has been called to reap the process. That memory is too important to leave idle for long.)

Is there a child's PID?

I am currently in an operating systems class and my teacher spent half of the class period talking about PIDs. She mentioned, as many know, that processes know their parent's ID.
My question is this:
Does a process's PCB know its child's ID? If so, what is the way to go about it obtaining it?
As far as I know a process doesn't have an explicit list of its children's PIDs, but it can easily be built, since a process should know which child processes it spawns. For example the UNIX fork() call returns the child PID in the parent process and 0 in the child process, CreateProcess() on Windows returns (IIRC) the PID of the new process created.
When you use fork() on *nix, the return value is the PID of the child in the parent process, and 0 in the child process. That's one way to find out.
Not sure if they keep track of the "tree" of process spawning, I think it depends on what OS you use, but since when you kill bash (or any shell), all running children are also killed, I think UNIX like systems do keep track of this.
If you're using Linux or anything which implements the Unix APIs, when a process calls fork() to create a child process the parent receives the child PID as the return code, or -1 if the fork failed. The child process gets a zero return code.
Process's PCB know its child's ID.
As we know the Fork() is used to create processes.It takes no arguments and returns a process ID.After a new child process is created both parent and child will execute the next instruction following the fork().
There we have to distinguish the parent from the child.This can be done by testing the return value of fork().
If Fork() returns a negative value, the creation of child process is unsuccessful.
If Fork() returns a Zero to the newly created child process.
If Fork() returns a positive value as a process ID of the child process to the parent process.