I may not be popular for suggesting this, but I'd recommend that you write
your measurement collection functions in unmanaged C++, and pass them into
the C# application for the rest of the work. You will get much better
control over timing.
If you are going to collect 1000 or 2000 measurements, and then stop
collecting, and then process data, you may be fine simply invoking garbage
collection at "safe" times (like before your data collection begins or after
it ends). On the other hand, if you collect your data using C# code, you
may have to have a way to prove that your measurements actually occurred at
10ms intervals, given that GC can occur at any time, and a plan for
collecting data again in the event that the first "measurement window" was
messed up by GC. IMHO, you are better off using unmanaged code for
fine-tune real-time measurements.
HTH,
--- Nick
"Bob lazarchik" <bo*****@yahoo.com> wrote in message
news:eN**************@TK2MSFTNGP11.phx.gbl...
Hello:
We are considering developing a time critical system in C#. Our tool used
in Semiconductor production and we need to be able to take meaurements at
precise 10.0 ms intervals( 1000 measurement exactly 10 ms apart. In the
future this may decrease to 5ms ). I am concerned that if garbage
collection invokes during this time it may interfere with our measurement
results. I have looked over the garbage collection mechanism and see no
way to control when garbage collection occurs. Is there a way to pause and
start garbage collection? or some other technique that I can use to
prevent garbage collection while I am taking measurements?
Thanks
Bob