Allowing Interrupts

  • Thread starter Thread starter Peteroid
  • Start date Start date
P

Peteroid

I'm writing a managed C++ application. Is there a function call I can make
that allows any interrupt event (e.g., Mouse Click on a Button) to process?

I'm writing a section of code that would best be served by running a long
time without 'interruption', ala statistical runs of a million or so of a
calculation which is complex enough that in order to run it that number of
times might take an hour or so (I'm collecting stats about the runs). I
currently run it once in a Timer Tick, and then let that continue to tick.

But this is very slow, so I'd rather be able to put the calculation in a
million-iteration 'for' loop, at the bottom of which there would be some
command that would say "ok, if anything else needs to be done do it now and
come back when you're done, or else fall through and do the next iteration".
I woud call such a function something like "AllowInterrupts()".

Does such a thing exist? Thanks in advance...!

[==Peter==]
 
Peteroid said:
I'm writing a managed C++ application. Is there a function call I can
make that allows any interrupt event (e.g., Mouse Click on a Button)
to process?

I'm writing a section of code that would best be served by running a
long time without 'interruption', ala statistical runs of a million
or so of a calculation which is complex enough that in order to run
it that number of times might take an hour or so (I'm collecting
stats about the runs). I currently run it once in a Timer Tick, and
then let that continue to tick.

But this is very slow, so I'd rather be able to put the calculation
in a million-iteration 'for' loop, at the bottom of which there would
be some command that would say "ok, if anything else needs to be done
do it now and come back when you're done, or else fall through and do
the next iteration". I woud call such a function something like
"AllowInterrupts()".

Does such a thing exist? Thanks in advance...!

Use a second thread to run your calculation leaving your main UI thread to
handle the mouse events.

-cd
 
Back
Top