|
-
Jun 19th, 2013, 05:16 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] System.Management EventWatcher, best practices?
Hi
I'm playing around with this class a little and it seems that while waiting for an event to happen it well waits, freezing the thread until the event is fired.
is this normal behaviour and if so lets say im monitoring the system, would i put these watchers into there own threads?
or is this class not really meant for this?
Yes!!!
Working from home is so much better than working in an office...
Nothing can beat the combined stress of getting your work done on time whilst
1. one toddler keeps pressing your AVR's power button
2. one baby keeps crying for milk
3. one child keeps running in and out of the house screaming and shouting
4. one wife keeps nagging you to stop playing on the pc and do some real work.. house chores
5. working at 1 O'clock in the morning because nobody is awake at that time
6. being grossly underpaid for all your hard work

-
Jun 20th, 2013, 01:03 AM
#2
Re: System.Management EventWatcher, best practices?
I've never actually used that class myself but, from a quick look at the documentation, it appears that you are probably calling the WaitForNextEvent method, which is synchronous and gets just the next event, when you should be calling the Start method, which gets all events up until you call Stop and returns them via the EventArrived event, which is presumably raised on a thread pool thread.
-
Jun 20th, 2013, 01:57 AM
#3
Thread Starter
Fanatic Member
Re: System.Management EventWatcher, best practices?
aahh , yes i was using waitfornextevent. i didnt try anything else yet
thanks, ill have a look at those
Yes!!!
Working from home is so much better than working in an office...
Nothing can beat the combined stress of getting your work done on time whilst
1. one toddler keeps pressing your AVR's power button
2. one baby keeps crying for milk
3. one child keeps running in and out of the house screaming and shouting
4. one wife keeps nagging you to stop playing on the pc and do some real work.. house chores
5. working at 1 O'clock in the morning because nobody is awake at that time
6. being grossly underpaid for all your hard work

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|