Effective Fine-Grain Synchronization for Automatically Parallelized Programs Using Optimistic Synchronization Primitives