How to keep a .NET console app running?
you always want to prevent using while loops, especially when you are forcing the code to recheck variables. It wastes CPU resources and slows down your program. I would definitely say the first one.
you always want to prevent using while loops, especially when you are forcing the code to recheck variables. It wastes CPU resources and slows down your program. I would definitely say the first one.
Yes. It’s like the difference between a tollbooth and a door. The ManualResetEvent is the door, which needs to be closed (reset) manually. The AutoResetEvent is a tollbooth, allowing one car to go by and automatically closing before the next one can get through.