If you make a seq of objects, you should be able to access the individual 
elements of the seq by their raw pointer address from your threads, and put a 
lock in these individual elements for fine grained locking of their contents.

>From your different threads perspectives, ignore the fact that these objects 
>are stored in a seq, just handle them as an array of objects with a fixed, for 
>which the first member lives at `s[0].addr`. Make sure not to share the ref 
>itself among the threads, only the raw ptr address of the 1st element. Also, 
>do make sure the seq itself gets referenced somewhere in the main thread to 
>prevent it from being destructed when you are not looking.

Reply via email to