3 ms·
Actually, no it wouldn't. The second thread makes a copy of the list and adds a new item. The next time the first thread goes through to mark everything 'paid
by wccrawford 15y ago
Actually, no it wouldn't.
The second thread makes a copy of the list and adds a new item.
The next time the first thread goes through to mark everything 'paid', it either gets an empty list, or a list that still contains everything it supposedly moved elsewhere earlier, depending on how you handle it.
- ori_b 15y agoRight, you need lazy lists (or generators) for this to work naturally. eg, in python: paid = (markpaid(x) for x in list_records())