Arc Forumnew | comments | leaders | submitlogin
1 point by garply 5364 days ago | link | parent

akkartik's code died on me with the first time I ran it, but I haven't been able to reproduce it.

This is what happens with palsecam's code:

arc> (= var 0 tbl (obj var 0))

#hash((var . 0))

arc> (repeat 50000 (thread (++ var) (++ tbl!var)))

nil

arc> var

49999

arc> tbl!var

50000



1 point by palsecam 5364 days ago | link

  arc> var
  49999
is strange, but the code you tried is not the one demonstarted a bug. You should 'sleep in the threads (i.e: the second example in my comment).

-----

1 point by garply 5363 days ago | link

When I do the second example, I get results similar to yours.

-----