![]() |
| ||
| Working with threads 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 |
| ||
| Re: Working with threads Found the answer myself. And it's yes, I do need to call Synchronize() or the program hangs at random points. Sub Xero |
| ||
| Re: Working with threads Quote:
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 |
| ||
| Re: Working with threads 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 |
| All times are GMT -4. The time now is 11:00 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC