RE: Help Thread pooling ???
- From: serge calderara <sergecalderara@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 2 Jun 2005 06:06:02 -0700
I just try your suggestion use the invoke at each node but it freeze
immediatly for ever.
It freeze as soon as the Invoke line start to be executed
I am stuck indeed out of idea.
"Jakob Christensen" wrote:
> The necessary call to Invoke causes the update of the treeview to execute on
> the thread of your form. This means that the UI will be unresponsive while
> the treeview is being populated because the main thread is busy.
>
> If you want the UI to be more responsive you might want to try changing the
> code so that Invoke is called once for each item instead of once for all
> items. This will give the main thread a little extra time to update the UI
> inbetween the calls to Invoke. You may have to add some code to handle the
> case where the user closes the form while the tree is being populated.
>
> HTH, Jakob.
> --
> http://www.dotninjas.dk
> http://www.powerbytes.dk
>
>
> "serge calderara" wrote:
>
> > Dear all,
> >
> > I have a function that I need to run in a thread due to the fact that it can
> > takes long time to execute according to the amount of data to collect.
> > This function is also populating a treeview control whne collected data gets
> > finished.
> >
> > In order to achieve this I have used the following code :
> > System.Threading.ThreadPool.QueueUserWorkItem(New
> > System.Threading.WaitCallback(AddressOf GetListOfReelsFromRemoteDB))
> >
> > Then my function definition is as follow :
> >
> > ===>>
> > private sub GetListOfReelsFromRemoteDB
> > m_objRemoteHist = New Remote(m_sRemoteDbPath)
> >
> > m_objRemoteHist.Read()
> > Dim sParam(0) As Object
> >
> > sParam(0) = m_objRemoteHist
> > tLogView.Invoke(AddReels, sParam)
> > Me.Cursor = Cursors.Default
> > end sub
> > <<===
> >
> > The Read routine, collect data froma remote database
> > When Read return, it populates a tree view control with a delagate object by
> > using the Invoke.
> >
> > Problem I have is that when tLogView.Invoke(AddReels,sparam) execute, it
> > frees my whole application and gets "no responding status". I guess there
> > shuld be something wrong with the thread queue process but do not know why
> > and how to solve it
> >
> > Does anyone could help ?
> >
> > regards
> > serge
.
- Follow-Ups:
- RE: Help Thread pooling ???
- From: Jakob Christensen
- RE: Help Thread pooling ???
- References:
- Help Thread pooling ???
- From: serge calderara
- RE: Help Thread pooling ???
- From: Jakob Christensen
- Help Thread pooling ???
- Prev by Date: Re: OT: Fastest Database?
- Next by Date: EnvDTE and EnvDTE80
- Previous by thread: RE: Help Thread pooling ???
- Next by thread: RE: Help Thread pooling ???
- Index(es):
Relevant Pages
|