Re: CMPXCHG

Ingo Oeser (ingo.oeser@informatik.tu-chemnitz.de)
Thu, 17 May 2001 13:43:35 +0200


On Wed, May 16, 2001 at 03:37:00PM -0700, Scott Huang wrote:
> Four adapters need to produce data to a
> descriptor queue which is consumed by a
> user process. A lock mechanism was implemented
> to sync the adapters. However, this causes
> a performance hit. Is it possible to use
> CMPXCHG on Intel's i-386 to avoid the locking?

What about using atomic operations for that? This is more general
and works on ALL architectures. CMPXCHG is just and special
atomic operation on ia32.

> Where can I find some doc and some sample code?

Documentation/DocBook/kernel-hacking.tmpl

But better do

make htmldocs

in the kernel top level directory and read

Documentation/DocBook/kernel-hacking/lk-hacking-guide.html

instead.

Sample code is scattered all around in the kernel.

Regards

Ingo Oeser

-- 
To the systems programmer,
users and applications serve only to provide a test load.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/