"Main" thread in CF programs

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?
 
C

Chris Tacke, eMVP

Should work fine as long as you make sure that the UI is only updated from
the thread that created it.

-Chris
 
J

Jon Skeet [C# MVP]

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.
 
J

John Roberts

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
 
D

Daniel Moth

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top