Premature Death of a Thread

  • Thread starter Thread starter Bart Van den Poel
  • Start date Start date
B

Bart Van den Poel

I have made a Small Pocket PC app that works over a GPRS network.
The App contains a Thread that periodically polls over the internet
to see if there are messages for it. If there are, the Thread makes a
Webservice connection to a Web Server and gets some data of it.

All's well but sometimes the thread just plainly stops working for no
apparent reason.
It just quits, not doing anything. It happens at random intervals so its is
hell to debug.

Does anyone have any idea what this could be.
 
Bart

Are you updating the UI from your thread? the Compact Framework does not fully support updating forms from secondary/worker threads. By attempting to do so will randomly lock up you app

Also, are you using the ThreadPool? You have to remember that the threadpool waits for threads to be available before it can restart your work - and this may not be immediately

Zahid.
 
Are you updating the UI from your thread? the Compact Framework does not
fully support updating forms from secondary/worker threads. By attempting
to do so will randomly lock up you app.

I actually do that with a delegate, like it is described in the
documentation. It doesn't work 100% ?
 
Are you updating the UI from your thread? the Compact Framework does not
fully support updating forms from secondary/worker threads. By attempting
to do so will randomly lock up you app.

Well, actually my app doesn't lock up, the thread just quits.
 
Just as a point of information, Windows doesn't support updating the UI from
a worker thread at all, period, in any version. This is true for VB.NET on
the CF and it's true for C++ on the PC. This is not a CF limitation, it's
how Windows works.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Zahid said:
Bart,

Are you updating the UI from your thread? the Compact Framework does not
fully support updating forms from secondary/worker threads. By attempting
to do so will randomly lock up you app.
Also, are you using the ThreadPool? You have to remember that the
threadpool waits for threads to be available before it can restart your
work - and this may not be immediately.
 
Back
Top