Sharing data structures in two threads of a piano roll

I’m trying to build a piano roll connected to a vst as my final project for my engineer degree, but I’m having problems in the multithreading part. I split my piano roll in a GUI and an audio thread, and they share a list with the notes to be played. But I don’t know what’s the best solution to avoid races without using locks. I saw some papers where someone developed a lock free list (but it looks complex); or I thought in sharing a fifo buffer to notify changes and have two lists one in the GUI another in audio thread; and updating the one in the audio thread with a timer. 

Thanks in advance. 


There's a great lot to learn to do this right!

I got a great deal of help on this forum when I asked a similar question, here's the resulting thread(s), in order of usefulness to you: