Re: Compiler vs. machine issue




"Francesco Savastano" <francosavastano@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
wrote in message news:431869e7$1@xxxxxxxxxxxxxxxxxxxxxxxxx
> I had same kind of problem yesterday: I usually work on my laptop (Win XP
> home P4 3GHZ) and compile there my exe. Yesterday when i tried to run such
> exe on my home computer (same O.S. but Athlon 1.5 GHZ cpu) a thread that I
> use in the program didn't work correctly. I suspected something with cpu
as
> it is the only difference betwen computers. So I tried to compile the same
> program (with same compile settings) on my home computer and magically it
> worked. Now I definitely solved the problem changing some parameters in
the
> thread that make it faster or slower etc..
>

I would be very uncomfortable with this program. Timing issues should not
effect properly written multithreaded programs. Threads in multithreaded
programs will not lock up and will always work properly if access to objects
and memory are performed correctly. Various threads must not have access to
the same objects unless said objects are built to be used by multiple
threads, i.e. thread safe. Objects or memory which are not thread safe must
be guarded by critical sections. There are other Secondary threads must
never be allowed access to visual components, this is what synchronize is
for which, imho, shouldn't be touched. If the GUI must be updated when a
thread operation is complete then a message can be posted to the main thread
where the update can take place safely. Intra-thread communication is best
done using windows messages and perhaps message objects which hold data
associated with the message. The object is created in one thread, the
reference(pointer) to the object is passed in LParam or WParam, the
receiving thread typecasts the reference, and after use frees the object.
You can also use an objectlist, stack or queue to hold objects, and protect
all accesses to it with a critical section. If you must wait for a thread
to finish then you can use TThread.Waitfor. There are many methods and
objects you can use to help write thread safe programs beyond these. If
timing issues continue to prevent your code from doing what is intended,
then the code is not finished.

Brent S.

.



Relevant Pages

  • Re: Print statement within If-Then block changes output!!!????
    ... assembler/compiler into producing it. ... ordinary variable because all of them are BCD floating point. ... POKE a value into memory, ... It sounds like they're supposed to compile. ...
    (comp.lang.fortran)
  • Re: Dual Core or Quad Core when running Quartus 7.1
    ... You're right about the importance of memory sub-system performance -- ... You have to tell Quartus that you want it to use more than one ... that compile time ...
    (comp.arch.fpga)
  • Re: 7.0 CPU and Memory Performance
    ... Since I was doing this on the same machine, with completely different builds (not simply a compile upgrade, but a full install), I figure it doesn't really matter what kind of machine it is, but just for grins, it is a Dual Opteron with 2GB of memory in it, compiled with the i386 confs. ... Now, I really don't know exactly what the ubench program is doing, but I think the description says that it is doing random integer and floating point operations for the CPU tests, and random memory allocation and copying for the memory test. ... I tried to run a PHP script using php 4.4.7 and got the following results: ... do the slower memory operations cause that difference in the real time it takes to run that script??? ...
    (freebsd-performance)
  • Re: 7.0 CPU and Memory Performance
    ... Before doing this, I wanted to take some benchmarks to see how the scripts that I would run would fare between the two versions, and the results are somewhat confusing... ... Statically compile the 5.4 binary, and run the same binary on both ... Robert N M Watson ... Now, I really don't know exactly what the ubench program is doing, but I think the description says that it is doing random integer and floating point operations for the CPU tests, and random memory allocation and copying for the memory test. ...
    (freebsd-performance)
  • Re: 7.0 CPU and Memory Performance
    ... I wanted to take some benchmarks to see how the scripts ... Statically compile the 5.4 binary, and run the same binary on both ... And a rerun of the FreeBSD 7.0 ubench making sure there is absolutely no activity on the box ... The author's description of his benchmark doesn't inspire confidence: it does "rather senseless memory allocation and memory to memory copying operations for another 3 mins concurrently using several processes". ...
    (freebsd-performance)