Re: [linux-audio-dev] shared memory synchronization

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] shared memory synchronization
From: Bill Gribble (grib_AT_cs.utexas.edu)
Date: to syys   30 1999 - 19:24:09 EDT


est_AT_hyperreal.org writes:
> 1) Correct volatile declarations are important. It would be nice if C
> guaranteed that these aren't needed if you have function calls between
> uses of a pointer, but that doesn't seem to be the case. BTW, on the
> other end of the aliasing spectrum, c9x has a `restrict' type
> qualifier that allows the programmer to provide guarantees against
> aliasing.
>
> 2) Multiprocessor cache synchronization. POSIX guarantees that
> certain operations (e.g., pthread_mutex_lock()) will cause this to
> occur. Do they under linux? Does the lock/cmpxchgl operation used
> by linuxthreads, for example, cause this to happen? This is very
> important to me as I'm working on SMP-friendly approaches to garbage
> collection and problems here will cause more than imperceptible audio
> glitches.

My understanding is that these two are an either/or proposition
in most cases. If you faithfully use mutex synchronization of
shared variables, volatile is always superfluous (and can be a major
performance hit).

If someone knows better, please let me know... i have tens of KLOC
of multithreaded real-time vision code that depends on my understanding
being correct :)

Bill Gribble


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:27:12 EST