Hi Pete
>Hi All, I've been following this thread with interest and thought I'd put in my two cents worth, I copied both sets of example code , increased the iterations to 10000 and wrote the output to a text file. The thread1.Start() version gave a much fairer slice of time to the threads involved (typically running 30 or so iterations before swapping threads ) whilst the BackGroundWorker ran for 3 or more thousand loops ( fed up typing iterations ) before swapping ! Just an observation :-)
Glad you've found this entertaining :) I though Einar was going to beat me up at one point <bg>
IMHO, the "raw" approaches tend to yield more performant and controlled results. The BackgroundWorker component is OK for use with forms and for UI devs that possibly don't have too much experience with threading. If you want to simply run a report in the background or call out to some service or other from the UI, then sure, use the BackgroundWorker component. Otherwise, there is a great arsenal of high'ish level threading capabilities provided by .NET that I would use as a start point.
Are you still doing Fox, Pete, or have you moved into .NET or something else?
Cheers
-=Gary
-=Gary