Give each thread a random unique ID (or a counter).
Say thread 1 = 111 and thread 2 = 222.
The table would look something like:
Sex, Age, ID
Male, 18, 222
Female, 22, 111
Female, 25, 222
Male, 20, 111
Then chose to sort the table by the column called ID (added in v5.9.7.1) and it would result...