[Autogenerated] what is the job anyway?
A job is one kind of kernel object and it manages a
set of processes in some way.
A job without processes is completely useless.
So the basic notion of a job is the ability to impose limits
on processes that are part of the job,
A job automatically provides something called accounting information,
which essentially means some kind of statistics that are
being tracked for all the processes within the job without
having to set anything in particular.
So even if you don't impose any kind of limits on a job,
then it's still very useful to get that accounting
information such as CPU consumption,
higher consumption and things like that without having
to query each process individually.
Another thing we can do with the job is associate
something called an I O completion ports.
Another completion protein general is the windows kernel object
that allows triggering some kind of notification that then allows
some function to be run by a bunch of threats or one of the
threats within a thread pool.
Now,
I O completion ports are typically used for handling asynchronous operations,
but they can also be used as a notification mechanism for
things that are happening in the job.
For example,
if a limit gets violated or if a process gets created inside the job then the I.
O completion ports can be triggered and some code you register by
waiting for the I O completion ports can then execute,
this is of course completely optional.
Now,
once the process is assigned to a job it can never get
out and so this is a one way street, so to speak.
And that makes sense because if the process could say,
well, I don't really like this limit, just get away from this job.
That wouldn't make much sense.
And so it's something that you can't really do once the process enters the job,
it's going to be in that job until the end of its life.
Now, what happens if a process inside the job creates another process by default,
that process gets into exactly the same job unless the
creation function to create process, API uses a flag called create process.
Break away from job, which is the way to say it.
I would like to create the new process outside of my job.
So this would work unless the job has explicitly forbidden
getting out of it by child processes.
But without any special flags,
the new process will be created in exactly the same job.