Jon
Tue Mar 04 02:59:28 CST 2008
Carl <ask@4it.com> wrote:
> Is it OK to start at thread so it does its work, and just forget about it.
Absolutely.
> Will it automatically dissapear when it is done? For exampel, like this:
>
> Thread t = new Thread(ReportingForm.StartProcessingReports);
> t.SetApartmentState(ApartmentState.STA);
> t.Start();
>
> No Join or anything like that.
Looks fine to me.
You might want to think about whether the thread should keep the
process alive if all the other foreground thread dies - if not, set
IsBackgroundThread to true.
--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
World class .NET training in the UK:
http://iterativetraining.co.uk