Previous | Next --- Slide 13 of 60
Back to Lecture Thumbnails
ismael

This reminds me of something I was trying to do in Programming Assignment 2. I had a map of TaskIds->ints where the integers were the number of dependencies that particular task had. My implementation ended up using coarse-grained synchronization, however, I was thinking of defining the map in the following way: myMap>. I went to office hours to ask about the differences between these two approaches and was told that atomics do not guarantee a certain ordering while locks can. I am still a bit confused as to what this means. Are there any key differences in program execution/correctness between using coarse-grained synchronization and fine-grained synchronization in this specific scenario?

Please log in to leave a comment.