Re: [LAD] Jack midi sequencer, threading and shared state

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Burkhard Ritter <burkhard@...>
Cc: <linux-audio-dev@...>
Date: Tuesday, August 27, 2013 - 5:53 pm

[Burkhard Ritter]

It's been a while since I did some research: IIrc on i386, 32-bit read
or write access is atomic if the variable address is 32-bit aligned,
while on ARM only byte-size read and write operations are atomic,
regardless of alignment. (On a sidenote, it is not realistic to
expect gcc to honour alignment instructions.)

However, you're probably well-advised not to take my word on it. You
better research this thoroughly yourself before designing your
multithreaded architecture around it. You might go weeks before
encountering a problem, and then you might spend a week trying to hunt
it down as these things are often very difficult to recreate and
isolate, and then you might discover your basic assumptions were
wrong.

For passing data between threads locklessly in a deterministic manner,
I'd recommend a FIFO, which you can build with byte-sized counters.

Hope this helps,
Tim
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAD] Jack midi sequencer, threading and shared state, Burkhard Ritter, (Sat Aug 24, 10:11 pm)
Re: [LAD] Jack midi sequencer, threading and shared state, Tim Goetze, (Tue Aug 27, 5:53 pm)
Re: [LAD] Jack midi sequencer, threading and shared state, Burkhard Ritter, (Tue Sep 17, 12:34 am)
Re: [LAD] Jack midi sequencer, threading and shared state, Alexandre DENIS, (Tue Sep 17, 8:25 am)
Re: [LAD] Jack midi sequencer, threading and shared state, Burkhard Ritter, (Tue Sep 17, 6:34 pm)