That's correct behavior. Although you would think one event should be generated, there are actually more file io events happening under the covers that may generate the notification. I'm working with FileWatcher right now and sometime I get four change events when saving a file.
When we signal an event (say, invoking set method of ManualResetEvent instance), then two basic questions,
1. no matter how many threads are waiting on the event, all of them will be awoken and executed at the same time, right?
2. If some other threads execute to statement WaitOne, after the ManualResetEvent is signalled -- say, in step (1), but not reset back into non-signalled status, the thread's execution will not be blocked, right?
Yes, both are correct. An AutoResetEvent will only release one thread, a ManualResetEvent releases all waiters. Any future thread calling WaitOne (or WaitAny, or WaitAll if all the other objects are also signalled) will be released immediately without blocking, until the event is reset.
DoEvents: Generating unexpected recursion since 1991
There are two of these controls in my windows application.
checking the items in the first one should cause the items in the second control to populate.
At present I use the mouse_leave event on the first control to trigger the event to populate the second control.
Is this the proper event I should use? I do not think the selectedIndex event is the correct one for this purpose either. Any suggestions please?
i'm working on an programe that reads several items from an MySql Database,
i've got the connection working. but for the last couple of days i've been struggeling.
I want to add items to the database via the use of 2 textbox but i'm cluesless on how to get the query,
i've been going over several pages tough all seem to fix on MMSql 2005 or on the connection string.
Any help would be greatly apriciated
Any code that attempts to do this at the moment would be useful to see. It will help us point out where you're going wrong.
In the mean time, I suggest you read this great article here[^], specifically the section about parametrised queries. In short, you take the user's input and create a new MySqlParameter object from that information and perform an INSERT statement.
He who makes a beast out of himself gets rid of the pain of being a man
If all the Finalizer methods of all the used classes in a thread are programmed properly, means native resource are released in Finalizer (e.g. implementing Dispose pattern), no matter how the thread is terminated (normally, by Interrupt or by Abort or by Exit or ...), there should not be any resource leak, right?