[Autogenerated] Our next kernel primitive,
to Discuss in terms of synchronization, is an event In fact,
we've seen an example of using an event in the previous module in this course.
But now it's time.
To more officially discuss what an event is and
what are the options of using it.
An event is a very simple object, in the sense,
that It just maintains the Boolean flag when the flag,
is up the event is signaled when the flag,
is down the event is non signaled very simple.
However, to make things, a bit, more interesting there,
are two event types supported one of them.
Is called the Manor Reset, event and You'll find the name notification.
Event being used.
In the kernel documentation such as the Windows driver kit,
and The other one, is called an URI event in user more documentation,
and called synchronization, event in kernel documentation,
a many recent event When you set it can release any number of threads
waiting on that event an auto recent event On the other hand,
only releases one thread.
So let's say I have an auto, event and I call the set,
event a P I, to raise the flag.
If we have say tens, waiting on that event only one of them will wake up.
And continue running while the others will continue waiting.
And the state of the event will drop back immediately.
To the non signal state.
That's why its called an auto reset.
Event automatically being reset after releasing one thread.
On the other hand,
a many recent event can release any number of threads currently
waiting on that event waiting until it becomes signaled,
which means that the event,
is up the purpose of an event is to provide flow synchronization.
It's not about protecting shared data It's about doing
something like not fi notifying whoever.
Is interested.
That something interesting has happened.
Maybe one thread, is doing some work.
And then setting,
an event indicating some work has been done some data is available,
that might cause another thread, to wake up or even multiple threats.
To wake up in order to grab, that data and do something with it.
And So on.
So it's about flow rather than trying to protect some kind of shared data
Let's see an example of using an event in the context of the