netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Kegel <dank@kegel.com>
To: Solmaz Mustafa <mustafa.solmaz@uk.thalesgroup.com>
Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org
Subject: Re: Atomic.h for PPC
Date: Thu, 09 Oct 2003 08:59:40 -0700	[thread overview]
Message-ID: <3F8585EC.3040908@kegel.com> (raw)
In-Reply-To: <41DD7618430DD411870400D0B746EDED0DC82C4F@mail.tms-ltd.com>

Solmaz Mustafa wrote:
> I am trying to develop a program on PowerPC and as trying to use LOKI's
> smart pointers I had some problems of compilation. 
> Loki's headers use atomic_inc_and_test() and atomic_dec_and_test() atomic
> operations for multi-threaded purpose. Those methods are available in many
> of Linux Kernel APIs but in the one for Power PCs. Almost all
> /usr/include/asm/atomic.h files have those methods well defined but on Power
> PCs. 
> 
> My atomic.h is 11th version and that it has atomic_inc_return() method which
> I suppose will be used later as atomic_inc_and_test() method.
> Would you please show me a way to sort out this problem? I can write my own
> methods using the current atomic.h but I just do not know how to implement
> it in a safe way. 

This is off-topic for linux-net.
Please try posting your question on a more appropriate group,
e.g. one of the lists at http://lists.linuxppc.org/

I have a feeling you're writing a user-mode program, so you
shouldn't care about the kernel's atomic operations.  Since
you seem to be using c++, I'd suggest having a look at
http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html#Thread%20safety
and maybe searching the archives of the gcc or libstdc++ mailing
lists for similar questions.
- Dan

-- 
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045

      reply	other threads:[~2003-10-09 15:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-09 14:28 Atomic.h for PPC Solmaz Mustafa
2003-10-09 15:59 ` Dan Kegel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F8585EC.3040908@kegel.com \
    --to=dank@kegel.com \
    --cc=linux-net@vger.kernel.org \
    --cc=mustafa.solmaz@uk.thalesgroup.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).