Analysis and optimization of synchronization algorithms for multicore architectures