CAS Vs Synchronisation

Compare And Swap (CAS) might be more expensive comparing to Synchronisation on CPU because it keeps the CPU busy, typical compare and swap is done via

while (!atomicBooleanLock.compareAndSet(false, true)) {
	// blocking
}

this will actually keep the CPU busy, makes it less adaptive to context swap and not utilising the full CPU potential.