In reply to sj1992:
There is a race condition between the fork/join statements. There is no defined order of execution of the forked statements, so you may see a variation in behavior between simulators. However, running repeatedly on the same simulator will give you the same results. Hence the reason you only see 'a=b=1'.
Try reordering the statements in the fork/join block and see what happens.