I could be wrong but synchronize doesn't necessarily protect you in multiple 
threads. The best way to handle threading in my opinion is to handle all 
processing in the thread. Whatever objects you need, create them in the thread. 
The Stringlist you mention should be created in the thread and use a 
synchronize to copy the data into and out of it. If that still doesn't work, 
look at using mutex's. I seem to remember that things get a lot more 
complicated in more than one thread and mutex's were recommended. 
 
Dave

Carl Jacobs <[EMAIL PROTECTED]> wrote:
>
> the VCL is not threadsafe. You're supposed to access it only in
non-threading mode (IE. accessing using synchronize() from within the
thread). With multiple threads accessing the VCL is even more complicated..
using mutex's or something. Have you done all that?
>
> Dave
>

I'm aware that the VCL is not threadsafe, but does that include the memory
manager? All the threads (all 2 of them) use Synchronise to do most of the
processing. Something along the lines of :

procedure Thread.Execute;
begin
  { other code - including string manipulations, but definitely no
references to VCL stuff as far as I'm aware }
  if need_to_do_action then
    Synchronize(do_the_action);
  { other code }
end;

I may be using TString:List references in the thread - I'll go and check
that, but definitely not any visual component stuff - I wonder if that could
be getting me into trouble? Hmmm, yes I was referencing a TStringList
entity, and getting rid of it seems to have reduced the frequency of
occurence of the problem! So I'll keep looking for other things that may be
related.

Thank-you for your help.
Carl.




-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 



---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
  
   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Non-text portions of this message have been removed]



-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to