Re: how to abort a thread in wince for pocket pc

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Even if there was an Abort method, the recommended approach is to periodically check from your worker thread a flag that indicates whether it should exit - you set the flag from your UI thread when you are about to exit your app. In other words, threads should not be killed rather they should be asked to commit suicide.

An example is here:
http://www.danielmoth.com/Blog/2004/11/dont-poll.html

Note that with CF 2.0 there are more options (such as setting the IsBackground=true property and not worrying about your thread keeping the process alive).

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Pradeep Kumar S" <PradeepKumarS@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:D6C33578-D3E8-40EE-A248-EF4D8D8D3687@xxxxxxxxxxxxxxxx
Dear all,
I am working on Wince for pocket pc using VS .Net 2003 with C#. I am running
one
thread in background. How to abort this thread so that my application will be
inactive.
Regards,
Pradeep Kumar

.



Relevant Pages

  • Re: wxPython and threading issue
    ... Have the main thread set a flag telling the worker thread to exit, ... safe state to exit. ... This means that the worker thread could only check the flag after each ... Imagine that it was, say, holding a lock when it was forceably ...
    (comp.lang.python)
  • Re: wxPython and threading issue
    ... The problem is, when the cancel button on the ProgressDialog is pressed, ... Have the main thread set a flag telling the worker thread to exit, ... safe state to exit. ... This means that the worker thread could only check the flag after each ...
    (comp.lang.python)
  • testing a database variable in my unix script
    ... i am trying to write a unix script to copy files from one directory to ... another depending on the value of a flag held on a databse table. ... If the flag is already N then i exit the scripts, ... !echo 'Executing jdselect ...' ...
    (comp.unix.questions)
  • testing a database variable in my unix script
    ... i am trying to write a unix script to copy files from one directory to ... another depending on the value of a flag held on a databse table. ... If the flag is already N then i exit the scripts, ... !echo 'Executing jdselect ...' ...
    (comp.unix.shell)
  • Re: Crossroads - when do you recode, and when do you start over??
    ... monsters. ... Flag as exit all the tiles that are considered out of range. ...
    (rec.games.roguelike.development)