ManualResetEvent.WaitOne(1) Waits More Than 1ms?

Sep 13, 2011

I am acquiring data with an HID device. The code below is a rough outline of my timing mechanism.

Dim CANTimer as New System.Diagnostics.Stopwatch
Dim resetEvent as New Threading.ManualResetEvent(False)
....

[code].....

View 1 Replies


ADVERTISEMENT

VS 2008 System.Threading.ManualResetEvent?

Oct 28, 2009

I'm just looking for other people's thoughts and opinions on the way I have done something.I have a console application which needs to connect to various computers and reset the local admin password on each one. I got it all working but then decided that as there are a lot of PCs, it would be a good idea to use the thread pool to do a few at the same time.The problem is, I need this program to be run without any human interaction - so I cant just use ThreadPool.QueueUserWorkItem and pass it all of the computers to connect to, because then the program would exit after it had called QueueUserWorkItem for each one because there is nothing left for it to do. I cant stick a Console.ReadLine in there because like I said, it needs to be run automatically without anyone typing anything.

View 1 Replies

Testing The State Of A Mutex Without Calling WaitOne

May 4, 2011

Is there a way to do a read-only test of the blocking state of a mutex? Currently I use the return value of WaitOne(0,False). This works fine, provided that if the return is true, I also call ReleaseMutex. Failing to do this, my test would corrupt the state of the mutex. So, the test is effective, but it has the irritating side effect of two state changes in the mutex. In addition, WaitOne and ReleaseMutex can throw exceptions and that further complicates matters. If WaitOne is successful and returns true, and if ReleaseMutex throws an exception, I can't clean up the mess that I have made.

View 17 Replies

Vb App Waits Upon Api Call?

Mar 26, 2012

I am using an API in order to get a program to print, when i load this api using print(), i get a dialog with ok, cancel, etc that needs to be dismissed before the vb app can run further: i never get to see MsgBox("hello world") until i dismiss it.

how i can run "mdwobj.Print()" and sequentially "MsgBox("hello)"?

Imports CcBase
Dim mdwobj As New CCMDW.MDW
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As

[Code].....

View 1 Replies

Make A Udp Server That Waits Client To Communicate

Apr 16, 2010

how i can make a udp server that waits client to communicate with him and the server answer them back even if the server doesn't know the ip of the client in vb.

View 3 Replies

Make A Form That Imitates A Load And Waits A Few Seconds?

Aug 15, 2011

load another form and i want a progress bar to work with it.

View 19 Replies

Excel VBA Code Waits Indefinitely When Excel Window Is Not Active

Sep 7, 2010

I have one excel sheet which has ontime event of 5 mins to run some code.This code works fine when in debugging mode. But if I lock my PC or minimize excel windows and start working something else, this code just pauses at beginning and as soon as I activate excel window, this code runs.this code involves opening and closing of one userform and i think userform is culprit.

View 2 Replies

Packet Capture And Threading, Capture Library Waits For "thread Stop"

Apr 5, 2009

So I am hacking together an app which listens to traffic using SharpPcap library, it reconstructs the packets from sessions using the code from TpcRcon.

Listening and reconstructing part work on their own . What I want is on each packet arrival main window gets an event so it can display the packet , and when session is reconstructed display a complete packet (I am interested in HTTP ones) . -That is where it breaks with weird symptoms: for example right now it does not stop on invoking stop listening method - the sharppcap library function hangs there forever waiting on this line of code : m_pcapThreadEvent.WaitOne();//wait for the 'stopped' signal from thread

I also had it not working and crashing in sharppcap function because I had omitted one parameter in form delegate- which makes no sense, because form delegate does not deal with packet capture at all and only reacts on "New Packet" event from my "Listener" class (which is only there to notify main form)

My app starts as module main instancing class "Listener". MainForm has it
registered as friend with event and handles even "New Packet"

Main Form:
Private Sub uiListenStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btListenStart.Click
aLogger.AddMessage("Started Listening")

[Code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved