PDA

View Full Version : Can we implement the multi-thread programming in OL?


thenongt
06-06-2007, 12:38 AM
I'm trying to do the background load large number of data. By repeatedly invoke webservice in background (because of 64K limit). Each time the data arrived, I combine them together into one dataset and the grid will be updated.

The reasons I have to do in this way is:
1. I must have all data available on client side, so I can do a real-time data filtering using XPath Query (I still don't know if this is the good solution, please tell me if I'm wrong).
2. By the 1, I don't want to let user wait until all data arrived. So I split data into parts and repeatedly invoke webservice to retrieve them (I call it the background load). The grid will be updated every time each part of data have arrived.

However, the background load doesn't work in background as I have expected. Each time the data arrived, the process that transform data always interupt the user activity in foreground such as mouse event or keyboard input and I don't want this to be happen.

So I'm thinking about to have other thread to handle the background loading. Is this the solution? Can it be possibled?

I'm not realy sure that I understanding it correctly. So if you have any ohter solution that can solve my issues, please help.

Thank you :)

hqm
06-06-2007, 03:00 PM
Are you using flash? Which LPS version?

The data loader in the Flash runtime has a mechanism which processes the incoming loaded data in discrete chunks, a little at a time , hooked to the LzIdle task event, so in theory this lets data processing happen "in the background" even though the system is not multithreaded. If you have a large amount of processing to do, you may need to do something similar; if you can encapsulate the state of your computation in some structure then you can register your work function to be run on the idle event, and you can limit the amount of processing that is done per step in order to preserve interactive response.

thenongt
06-06-2007, 06:06 PM
Thank you very much :)