Re: How to share data between threads



On 2008-09-13, Vladimir Vassilevsky <antispam_bogus@xxxxxxxxxxx> wrote:

Whenever there is anything shared between the two threads, I always use
the OS synchronization mechanism. It is not a good idea to rely on the
atomicity of *any* operation, because it is VERY system dependent. Also,
I avoid the communication between the threads via the shared objects.
Instead, I use the OS message passing mechanism,

How can that not be using a shared object?

which is guaranteed to be atomic and free from the priority
lockup. Albeit somewhat inefficient, this discipline allows
developing big projects and keeping them manageable.

--
Grant Edwards grante Yow! ! Up ahead! It's a
at DONUT HUT!!
visi.com
.



Relevant Pages

  • Re: How to share data between threads
    ... the OS synchronization mechanism. ... It is not a good idea to rely on the atomicity of *any* operation, because it is VERY system dependent. ... I avoid the communication between the threads via the shared objects. ... Instead, I use the OS message passing mechanism, ...
    (comp.arch.embedded)
  • Re: How to share data between threads
    ... the OS synchronization mechanism. ... I avoid the communication between the threads via the shared objects. ...
    (comp.arch.embedded)