Cashmere employs a release consistent protocol. Therefore, applications must adhere to the data-race-free programing model, which simply stated, means that memory accesses must be protected by locks, flags, or barriers, that are explicitly visible to the runtime system.
Most Cashmere synchronization operations invoke protocol methods responsible for keeping data coherent. A protocol acquire invalidates pages that have been recently modified by other processes, causing the library to automatically fetch an up-to-date copy of an invalidated page on a subsequent access. A protocol release propagates all changes made since the previous protocol acquire to the node responsible for the page (i.e., the home node) and sends invalidations to other sharers of the page.
void csm_lock_acquire(int index);
void csm_lock_release(int index);
long csm_barrier(int index);
void csm_acquire_flag(int index);
void csm_release_flag(int index);
void csm_wait_gt_flag(int index, long value);
void csm_wait_lt_flag(int index, long value);
void csm_wait_eq_flag(int index, long value);
void csm_wait_neq_flag(int index, long value);
void csm_inc_flag(int index, long value);
void csm_set_flag(int index, long value);
void csm_reset_flag(int index);
long csm_poll_flag(int index)