netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Atomic.h for PPC
@ 2003-10-09 14:28 Solmaz Mustafa
  2003-10-09 15:59 ` Dan Kegel
  0 siblings, 1 reply; 2+ messages in thread
From: Solmaz Mustafa @ 2003-10-09 14:28 UTC (permalink / raw)
  To: netdev; +Cc: linux-net

Hello,

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. 

Best regards,

Mustafa SOLMAZ

Thales Underwater Systems
United Kingdom
+441963 372 152
This email and any attachments are confidential to the intended recipient
and may also be privileged. If you are not the intended recipient please
delete it from your system and notify Thales Underwater Systems on +44 1963
370 551. You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Atomic.h for PPC
  2003-10-09 14:28 Atomic.h for PPC Solmaz Mustafa
@ 2003-10-09 15:59 ` Dan Kegel
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Kegel @ 2003-10-09 15:59 UTC (permalink / raw)
  To: Solmaz Mustafa; +Cc: netdev, linux-net

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-10-09 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-09 14:28 Atomic.h for PPC Solmaz Mustafa
2003-10-09 15:59 ` Dan Kegel

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).