Pergunta

The situation is: Scheduled tasks (with runnables) on multicore processors have to communicate with each other through shared global variables on a real-time system. Multiple runnables update same global value at the same time. This value will be stored in buffer. To ensure the correct value available for use, I am thinking to use read-modify-write class for buffer to avoid mutual exclusion, locks etc.

I want to know your opinions and comments about it e.g will the use of buffer with read-modify-write technique in real-time communication systems, work ? or is there any better technique to be used in such scenario ?

Please comment.

Foi útil?

Solução

You're not going to avoid locks/mutexes for your read-modify-write class. The problem is that with two threads and no locks, it turns into a read-read-modify-modify-write-write class.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top