Energy-Optimal Synchronization Primitives for Single-Chip Multi-Processors