8 ms·
Noone should imagine that. You definitely don't want two threads accessing the same vec or array at one time. Maybe if there's a lock
by ArrayBoundCheck 4y ago
Noone should imagine that. You definitely don't want two threads accessing the same vec or array at one time. Maybe if there's a lock
- nickitolas 4y agoIf it's read only, you can definitely want that, right? As long as the elements are Sync. And it should work (You might have a problem with the cleanup, but Arc or scoped threads should handle that). The problem is when one is a mutable reference, like in this case. AIUI you could have a single mutable reference to an element be used from another thread (For example, a scoped thread) if the elements of the Vec are Sync