Board index » cppbuilder » Re: all BCB6 apps: memory corruption in hyperthreading / dualCPU machines
Tom Widmer
![]() CBuilder Developer |
Tom Widmer
![]() CBuilder Developer |
Re: all BCB6 apps: memory corruption in hyperthreading / dualCPU machines2005-10-26 01:11:40 AM cppbuilder43 Zach Saw wrote: Quote>How about via the DataSet object? DataSet->Close() over and over again. Could you clarify that? It's still not clear whether you are doing something which one might reasonably expect requires synchronization, such as using a copies of an AnsiString in multiple threads (with the associated copy on write problems), etc. Tom |
Tom Widmer
![]() CBuilder Developer |
2005-10-26 01:15:37 AM
Re:Re: all BCB6 apps: memory corruption in hyperthreading / dualCPU machines
Jonathan Benedicto wrote:
QuoteZach Saw wrote: Calling Unique() after making the copy might solve the problem. Tom |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2005-10-26 01:37:19 AM
Re:Re: all BCB6 apps: memory corruption in hyperthreading / dualCPU machines
"Zach Saw" < XXXX@XXXXX.COM >wrote in message
QuoteI'm not writing to the global variable except in the GUI (TForm c'tor)... In any case, when sharing a global across threads, especially a data type that is not a POD type (integers, booleans, etc) then you should ALWAYS serialize access to it. Gambit {smallsort} |
Jonathan Benedicto
![]() CBuilder Developer |
2005-10-26 03:04:05 AM
Re:Re: all BCB6 apps: memory corruption in hyperthreading / dualCPU machines
Tom Widmer wrote:
QuoteBut they are reference counted, so if you access apparently Jonathan |
Zach Saw
![]() CBuilder Developer |
2005-10-26 10:28:07 AM
Re:Re: all BCB6 apps: memory corruption in hyperthreading / dualCPU machines
well, each thread has its own DataSet -- so I'm only opening and closing the
dataset in their own threads... so there're no sharing of AnsiString across threads, unless the code in VCL tries to be funny... :) "Tom Widmer" < XXXX@XXXXX.COM >wrote in message QuoteZach Saw wrote: |
Zach Saw
![]() CBuilder Developer |
2005-10-26 10:32:27 AM
Re:Re: all BCB6 apps: memory corruption in hyperthreading / dualCPU machines
the global variable is of type integer...
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message Quote
|
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2005-10-26 11:35:46 AM
Re:Re: all BCB6 apps: memory corruption in hyperthreading / dualCPU machines
"Zach Saw" < XXXX@XXXXX.COM >wrote in message
Quotethe global variable is of type integer... Gambit |
Zach Saw
![]() CBuilder Developer |
2005-10-26 02:10:52 PM
Re:Re: all BCB6 apps: memory corruption in hyperthreading / dualCPU machines
yeah, but there's nothing writing to the global var...
it's there just for testing memory corruption -- to see if the value it is initialized with is still the same at the end of the test program :) "Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message Quote
|
Chris Uzdavinis
![]() CBuilder Developer |
2005-10-27 11:08:17 AM
Re:Re: all BCB6 apps: memory corruption in hyperthreading / dualCPU machines
Tom Widmer < XXXX@XXXXX.COM >writes:
QuoteBut they are reference counted, so if you access apparently string, possibly messing up its refcount. -- Chris (TeamB); |