C
Chandy
Hi,
I am trying to get my head around threading and delegates and have
been reading the "Calling Synchronous Methods Asynchronously" document
on MSDN but, strangely, can't get any of the examples to fit in my
head with what I want. I say strangely because I thought what I want
would be very basic! Can anyone advise as to how to approach the
following problem?:
WinFormA has a timer which needs to call a static method in another
class on a schedule, but of course not be blocked by the call. Also,
it needs to not call the method again if the timer ticks and the
previous call has not yet completed.
Checking a simple boolean value on the form before calling the method,
which is updated on the EndInvoke of the delegate, would seem to do
it, but I just can't seem to find an example that doesn't block the
form gui thread until the result comes back. Note also that I don't
care about any result, I just want to call the method async only once
at a time.
Thanks,
Chandy
I am trying to get my head around threading and delegates and have
been reading the "Calling Synchronous Methods Asynchronously" document
on MSDN but, strangely, can't get any of the examples to fit in my
head with what I want. I say strangely because I thought what I want
would be very basic! Can anyone advise as to how to approach the
following problem?:
WinFormA has a timer which needs to call a static method in another
class on a schedule, but of course not be blocked by the call. Also,
it needs to not call the method again if the timer ticks and the
previous call has not yet completed.
Checking a simple boolean value on the form before calling the method,
which is updated on the EndInvoke of the delegate, would seem to do
it, but I just can't seem to find an example that doesn't block the
form gui thread until the result comes back. Note also that I don't
care about any result, I just want to call the method async only once
at a time.
Thanks,
Chandy