in reply to Re: Gtk2 ....needs thread testing on a multi-threaded computer
in thread Gtk2 ....needs thread testing on a multi-threaded computer

By the way, is this what they call a race condition

.....oooh i think i see the problem..... i thought $finish was the only var where locking was needed, but the main thread also resets $track{$tr}{'tot'} ...... each thread writes to it's own, but main resets them to zero

....on a single cpu machine it appears to work, probably because of its linear timing

....thanks for the report...i will have to think about how to handle locking $track{$tr}{'tot'}

if you could give a quick try at line 188

lock $track{$tr}{'tot'}; $track{$tr}{'tot'} += (rand 5) + $whip;

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku

Replies are listed 'Best First'.
Re^3: Gtk2 ....needs thread testing on a multi-threaded computer
by kikuchiyo (Hermit) on Dec 16, 2009 at 19:12 UTC
    I tried the fixed version - no segfaults this time, nor any other sign of incorrect behavior.
      ... hi, i just updated the script to lock all shared variables.... now the question is... are they locked properly for a multicpu motherboard?..... walmart had a multicore toshiba laptop for 399 awhile ago..... i should have grabbed one..... but they seem to get cheaper every year..... so no sweat :-) ..... thanks for testing it

      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku