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

Carl Jacobs <[EMAIL PROTECTED]> wrote:
THE QUESTION

Can I run two processes within a single application - the implication being 
that two copies of the memory manager would be invoked - or does the second 
process have to be a seperate application?

WHY I'M ASKING

I already write multi-threaded programs, but I seem to be running into a 
problem with the memory management unit in Delphi - like maybe somehow my 
program is confusing the memory manager. The evidence of it is that the 
programs will crash with access violation and pointer not defined errors on 
lines like the following:

procedure SomeProc;
var
  s : string;
  { other variables defined in here }
begin
  { other code }
  s := Format('%d',[var]); <-- Sometimes crash on this sort of line, with s 
being the problem!
  { other code }
  StringGrid.Cells[x,y] := 'Some String';  <-- Sometimes crash on this sort of 
line with the StringGrid Cell reference being invalid, even though the indexes 
are within the colum and row count!
  { other code }
end;

I have multiple threads running which are performing lots of string 
manipulation - with those strings being passed around between the different 
threads. The strings/cells as defined and used in the code example above does 
not normally bear any relationship to the strings being passed around by the 
threads - except of course that the same memory manager is being used to 
allocate and free those strings.

What is more suspicious is that I can run my program (a simulator of sorts) at 
different speeds (normal speed, x2, x3 up to x10) and the problem will only 
show up at the higher speeds - hence a greater probability of overlapping 
memory management.

Does this explanation of my problem even make sense?

I look forward to any help that can be given.

Regards,
Carl.






[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 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