[Autogenerated] I'm going to run it by pressing controller.
5 5 run the first instance.
So here goes the first instance.
We can see the handle value has the value F zero which F0,
and This one, is identifying itself as a controller process.
So let's look at cross explore,
see what we find here's app here's our first instance,
our first process.
Let's go.
To the handles, and I'm going to switch, to showing handles for named objects.
Only to make it just easier.
To see what's going on.
Here's the handle value F zero.
Notice it, is In fact, an event and notice the name it has shut down.
Event here as a suffix.
But apparently there's some weird prefix here called sessions,
two base named objects, and only then shut,
down event I'll explain what that means later on
towards the end of this module for now, let's just assume it says shut,
down event In fact, the full name is going to be The same in all these processes,
we'll launch very two If I double-click we can
see the properties of that object, remember,
double clicking shows properties of objects.
And not the actual handle, the handle, is just here.
So you can see there's a single handle right now,
which means this is it, that's the single handle.
We have to this particular object.
Notice also it, is signaled,
false which means it is in the down state or non signaled state.
OK.
So now let's go back, to Visual Studio and press controller,
five again, to run another instance.
So here's another instance, and notice, that it,
is identifying itself as a worker process being opening,
a handle.
In fact, to an existing object already the handle value, is different.
It may be different may be the same.
It doesn't really matter what matters.
Is what it actually points, to So going back, to cross explore.
Even before I look at the other instance,
simply double clicking the previous handle,
we can see the number of handles has been increased.
To two which means that that's one handle,
but there is some other handles somewhere.
In the system, to the same object, and of course,
we can verify by looking at the object address in the other process.
So here's the other process, the handle value,
is B B0 you can see here notice is the same name.
In fact,
the same address If we double-click we can see that we
see exactly the same information, the same two handles.
In fact, although it's not easy.
To prove perhaps using just this view.
We can also take a look, in the kernel debugger to verify.
But let's continue with that idea by creating a couple of more processes.
So here's another one again, identifying itself as a worker process,
the handle value, is different.
But as I mentioned earlier, it doesn't really matter.
Let's create a Final one, here's another one which happens.
To have a handle, be eight and It's also a worker process.
Now we have these four processes.
The first one has been identified as a controller,
and The other ones have been identified as workers.
And If I double-click any one of these handles,
it doesn't really matter which I can see the number of handles,
is four because we're sharing these objects.
It's exactly the same object.
This is exactly sharing by name which means that If
we change the state of the object.
For example, in this case for an event object,
that's the most significant change.
We can do for that kind of object,
the other processes will notice it or feel that if you will.
So here goes, let's put all these console Windows here in a way,
that is easy, to see what's going on.
So here we have these two here, is Another one that's the third In some way,
it's not always easy.
To kind of place them in a good location.
But here it goes.
And So we have the controller process.
That's the one here, and the other three processes here,
are waiting for the shot.
Down notification.
So once I press enter this is what I expect, I expect the other processes.
To immediately display the fact.
That They have noticed the change when I press.
Enter here set, event is going, to be called by the controller process.
And We expect the others.
To notice, that So here goes, and you,
can see that Immediately we get the output indicating they error
shutting down and performing whatever shut,
down activities they need to do before finally shutting down.
So all the process, are now gone.
All these air processes, are gone because they, they're just being terminated.
They are done doing the work.
So that's the idea we have managed to share an
object between multiple processes.
It, was an event object in this case,
but this kind of idea works for many types of objects where
names are possible examples include semaphores,
and section objects, and also timers.
So all these kinds of objects.
Mutu, access as well.
Can be shared by name which is very easy.
To do as you can.
See the only thing.
We need to do is just to decide upon a name, that Every other process.
That is Part of the same social system knows about and then simply use
that name as the way to create and use the object.
So the create event function here noticed actually
functions as a create or open kind of way.
So if the object doesn't exist prior to the call it is
actually created and We get the first handle,
to the object.
But subsequent calls, to create event succeed as well.
But in this case, there's no new object but we just get another handle.
To the same object.