3 ms·
zlist_first and zlist_next can be made thread safe by using a thread-specific variable for the iteration cursor, rather than a simple member of the list structu
by kazinator 11y ago
zlist_first and zlist_next can be made thread safe by using a thread-specific variable for the iteration cursor, rather than a simple member of the list structure.
Of course, that's a big, inefficient hack, and tied to a particular threading model (not generally reentrant).
Anyway, it's probably largely moot because neither example is safe if the list is treated as mutable (there is at least one writer concurrent with the reader).
- deleted 11y ago[deleted]