"Main" thread in CF programs

  • Thread starter Thread starter Jon Skeet [C# MVP]
  • Start date Start date
J

Jon Skeet [C# MVP]

Is there anything special about the thread which runs Main in the
Compact Framework?

In my current design, it would be more elegant to create a new thread
and run the UI on that, running the major processing on the entry
thread, than starting a new thread to do the major processing and
running the UI on the entry thread, if you see what I mean. This is
because the UI is basically just reflecting progress - it's not really
"driving" the application.

Does anyone know of any problems with that approach?
 
Should work fine as long as you make sure that the UI is only updated from
the thread that created it.

-Chris
 
Chris Tacke said:
Should work fine as long as you make sure that the UI is only updated from
the thread that created it.

Righto, that's what I'd hoped.

Cheers.
 
I once let the main thread exit after having created a window on another
thread and the application carried on running until that exited (I had half
expected the app to exit when the 'main' thread did).

- John
 
For info. If the other thread was a background thread then it would have
exited.
On CF 1.0 (unlike the desktop) background threads are not supported hence
your observation.

Cheers
Daniel

John Roberts said:
I once let the main thread exit after having created a window on another
thread and the application carried on running until that exited (I had half
expected the app to exit when the 'main' thread did).

- John
 
Back
Top