 بسم اللہ الرحمن الرحیم آج ہم موڈیول 151 دسکس کریں گے موڈیول 151 ہے about event usage models پریویس لی ہم نے events کو دسکس کیا تھا ہم نے دیکھا تھا event یہ بھی ایک object ہے windows کا جس کی مدل سے how we should ڈکسکتے ہیں سنکرانیزیشن کو انفوز کر سکتے ہیں تو اس کو use کرنے کے لیے مختلف قسم کے موڈلز استعمال ہو سکتے ہیں because the usage of the car according to the models are designed because the usage of the car according to the models are designed because either auto events or manual events are there and then to trigger events you either use set event or pulse event if we make a combination of all then we have four combinations that we can use and this is not a useless combination these are all useful depending upon the situation depending upon the scheme we need a different combination of every combination so these four combinations exist and we will use them in different situations let's see a table in that table these four combinations are discussed in detail in this table you can see that you can also use auto reset event with set event and you can also use manual reset event if you use auto reset event with set event then whenever a set event happens then a thread will be released many threads are blocked a thread will be released if any thread is not waiting then the first thread will be immediately released and then the event will automatically reset so this combination is auto reset with set event you used auto reset event with set event now if we use manual reset event with set event the event is manual reset but the API used to trigger the event is set event so in that case all the currently waiting threads many threads are waiting to enter in the critical section so all the waiting threads will be released all the execution will continue and the event will be signaled the subsequent threads will be released until the event is manually reset then again all the waiting threads will be released the third case is that you can use auto reset event with pulse event you can use auto reset event with pulse event API because auto reset is one thread will be released and it will be released only if it is currently waiting if any thread is not waiting then nothing will be released and then the event will automatically reset to non signaled state then if you use manual reset event with pulse event then all the currently waiting threads will be released and the event will be non signaled state because with pulse event will be reset in non signaled state so you can have these four conditions depending upon the situation you can read the zoo in these four different situations first case is that a thread is being released and it is being reset itself second case is that all the currently waiting threads are being released and also are being reset auto case automatically is being reset you have to reset yourself in manual case pulse case is like a pulse when pulse comes then it is released and when pulse ends then the event goes back to non signaled state now auto reset event can be understood like the path is stopped there is a door ahead and if the door opens then the door automatically closes there are many such doors there is a mechanism that you open the door and leave it when it is released then it automatically closes so auto reset is the same there are many such threads trying to enter from the door but the door is closed when the door opens it will pass through it and the door will automatically close in manual reset the door is not automatically closed it is manual you have to open it yourself and close it yourself it will open if someone is waiting then it will pass you have to close the door yourself pulse event you can understand pulse event like this that the door opens and it opens for a while if a single thread is waiting it will pass through it and after that the pulse means that a pulse has come the door opens during the pulse and then the door automatically shuts for a while a pulse will open and if you use manual reset with pulse event then the door opens in the case of manual reset so all the threads that are waiting will pass through it and then you have to close the door yourself you have to reset so the set event that basically opens the door and releases a thread and passes through it when a thread passes through it the door can automatically reset and manually reset so you can conceptualize all these things in this way i.e. you have to open the door in every case now you have to pass one number of threads you have to close the door automatically these are all variables these are changes from in combination to combination and depending upon the situation you need to use these combinations