Computer Science 225
Advanced Programming
Spring 2022, Siena College
Agenda
From the current topic notes:
We have a list with one element:
SimpleLinkedList<Integer> x = new SimpleLinkedList<Integer>(); x.add(1);
Then two threads each try to remove a value to make use of it in some way:
if (!x.isEmpty()) { int val = x.get(0); x.remove(0); // do something }
What is the intended behavior here? What could go wrong?
Terminology
Examples