Previous | Next --- Slide 35 of 66
Back to Lecture Thumbnails
xhe17

in this example thread2 first set prev->next = prev->next->next and free the address storing 10, next thread1 set prev->next = node_6 and node_6->next = node_10, however node_10 is is already freed, as a result we lost the tails of this linked list.

sagoyal

Something that still confuses me is if the behavior would be simultaneously running threads are on the same processor or not? To me it seems that the case's we've discussed with issue of the simultaneous delete and insert and the simultaneous insert and insert, only hold if the threads are on different processors. I believe that if the threads were in fact on the same processor then it would be possible that there could also be a delete delete case, since then one thread could clobber the memory of the other thread (since they would share a cache) and then we could end up clipping a very large chunk of the linked list.

Please log in to leave a comment.