Please provide a complete example that demonstrates your question. There are so many variables regarding the code you posted (initial values, any other assignments, etc) that it is impossible to answer your question.
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.