Hi Carl,
1st: for your Stringlist: there is a thread-safe tThreadlist which you lock and
unlock during accesses to it.
2nd: there is no difference between synchronize of two ore more threads, the
requred function is executed in the context
of the MAIN_THREAD.
3rd: something is ringing in the back of my head concerning thread-save
memory-manager, but I'm quite sure, that since Delphi5 there is absolutely
no exploit with the current manager.
I coud think of some other pitfalls: who tells, that a string allocated in one
thread MUST be accessible from another?
who says, that the memory-area where the string is allocated even exists in the
memory of the second thread?
I used in one of my pgms an inter-process-communication using file-mapping.
Have a look at the help of widows-sdk 'interprocess communication)
hope that helps!
Have fun
Bob
>
> >
> > 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
>
>
>
>
>
>
>
-----------------------------------------------------
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/