removeall() in list

Paul Rubin http
Fri Jan 11 15:57:39 EST 2008


castironpi at gmail.com writes:
> Any ideas for a thread-safe list.removeall( X ): removing all
> occurrences of X within list L, when L might be modified concurrently?

That way lies madness.  Do something sensible instead.  Put a lock
around the list, or put all mutators for the list into a single
thread, or whatever.  Don't do what you're describing.



More information about the Python-list mailing list