The development of correct synchronization code for distributed programs is a challenging task. In this paper, we propose an aspect oriented technique for developing synchronization code for message passing systems. Our approach is to factor out synchronization as a separate aspect, synthesize synchronization code and then compose it with the functional code. Specifically, we allow the designer of an application to first design the functional code. The designer can then annotate the functional code with regions and specify a high-level ”global invariant” specifying the synchronization policy. A synchronization policy essentially gives the occupancy rules for the various regions. The solution to this problem, which we term the region synchronization problem, involves deriving a set of rules for entering and exiting each region. We provide a systematic the invariant into a message passing algorithm for a point-topoint message passing system. We show that many existing synchronizat...