Ah! That's exactly the sort of thing I was hoping to come up with.
I was worried that the list of fixed particles may grow large, so copying it each time a particle is added, could be expensive. But if it is really only treated as a list, a persistent data structure would make the append/copy very cheap.
I see, thanks. I guess my confusion stemmed from not realizing that merely acquiring read locks on a RwLock (even though that supports multiple concurrent readers) is far from free, and can create a lot of contention.
In a way I'm already doing that, since I'm using a cell list to detect collisions. Currently I wrapped the entire cell list in a RwLock, but I'll see if I can do the locking on a finer-grained level (on a per-cell basis).
I know The reason for the -1 was that I was using one "special" thread to also handle output (not in the example code).