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

I've got this on the first run:

panic: attempt to copy freed scalar 296b060 to 1511250 at gtkthreadtes +t.pl line 188. Segmentation fault

I didn't see anything abnormal since that.

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

Replies are listed 'Best First'.
Re^2: Gtk2 ....needs thread testing on a multi-threaded computer
by zentara (Cardinal) on Dec 16, 2009 at 14:34 UTC
    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
      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