Hello everyone,
I'm quite familiar with Delphi, but I'm new to using threads and so I've got a question. Here's what I'm trying to do:
I'm using the brilliant VirtualTreeView component and I wish to add to it from a thread. The tree is on the main form and is not visible and the only thing that accesses this tree is the thread.
My understanding is that to access anything on the form I should use Synchronize(), but since the thread is the only thing that uses the component, do I still need this procedure?

Sub Xero

Found the answer myself. And it's yes, I do need to call Synchronize() or the program hangs at random points.

Sub Xero

Found the answer myself. And it's yes, I do need to call Synchronize() or the program hangs at random points.

Sub Xero

Honestly,

TMultiReadExclusiveWriteSynchronizer is MUCH better than Syncronize. Makes better use of memory and thread execution will stand much less of a chance of hanging.

Cheers

Hey man, thanks for the info I'll look into that. At the moment the Synchronize function is the main cause of slow down in my application, but until I'm confident that what I'm doing is correct, it's the safest option. So hopefully this may be a better solution.

Sub Xero

This question has already been answered. Start a new discussion instead.