Efficient Synchronization on Multiprocessors With Shared Memory