Programming for different memory consistency models