Threaded job

R

r

Hi,
As we all know, form loading is a heavy task in the CF.
I do use a cache mechanizm, but I would like my forms to be loaded
when the app is idle.
If during the loading the user start using the app - I want the loading
to stop (or rollback).
Does anyone has an idea how to do that? (operate when idle, stop
loading, rollback - or if the user chose to enter a form that is being
loaded, continue with the load, and have the main thread wait for the
background one)

thanks in advance,

razgrp
 
D

Daniel Moth

It is not a case of finding a thread master rather a case of you posting a
mixture of questions with proposed solutions both based on incorrect
assumptions. Let's split things out:

1. Backing off from loading a form etc as you describe it doesn't seem
sensible to me personally. You cannot just freeze other threads as and when
the user touches something.

2. In any case, you can only touch UI elements from the main thread so using
secondary worker threads is of no use when loading forms. You can only use
them for tasks that have nothing to do with the UI. If you want to do that,
check out the BackgroundWorker from SDF (from opennetcf) or explicitly use
threads. Some links that might help:
http://www.danielmoth.com/Blog/2004/10/invoke-cf-and-full-fx.html
http://www.danielmoth.com/Blog/2004/11/dont-poll.html
http://www.danielmoth.com/Blog/2004/12/backgroundworker-sample.html

3. To find out when the application is idle see these threads:
http://groups-beta.google.com/group...framework.compactframework&q=idle+application

Good luck!

Cheers
Daniel
 

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