Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Programming Threads > Re: std::msync
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 14 of 19 Topic 1373 of 4179
Post > Topic >>

Re: std::msync

by Alexander Terekhov <terekhov@[EMAIL PROTECTED] > Apr 6, 2005 at 08:59 PM

< Forward Inline >

-------- Original Message --------
Message-ID: <425423FE.30C8D4DF@[EMAIL PROTECTED]
>
Subject: Re: shared_ptr on ppc?
References: ... <42541BB5.AE56E560@[EMAIL PROTECTED]
>

Alexander Terekhov wrote:
[...]
> Got it now. Thanks.

  asm long atomic_decrement_weak( register long * pw ) {

      <load-UNreserved>
      <add -1>
      <branch if zero to acquire>

      {lw}sync

    loop:

      <load-reserved>
      <add -1>
      <branch if zero to acquire>
      <store-conditional>
      <branch if failed to loop else to done>

    acquire:

      isync

    done:

      <...>
  }

 asm long atomic_decrement_strong( register long * pw ) { 

    // Peter's state machine

    loop0:

      <load-reserved>
      <add -1>
      <branch if zero to loop0_acquire>

      {lw}sync

    loop1:

      <store-conditional>
      <branch if !failed to done>

    loop2:

      <load-reserved>
      <add -1>
      <branch if !zero to loop1>
      <store-conditional>
      <branch if failed to loop2 else to acquire>

    loop0_acquire:

      <store-conditional>
      <branch if failed to loop0>

    acquire:

      isync

    done:

      <...>
  }

All right now?

regards,
alexander.

< Forward Quoted > [Message-ID:
f4bc7d7d1041b71c5450aa06b68936ee@[EMAIL PROTECTED]
 Hinnant wrote:
> 
> On Apr 6, 2005, at 12:36 PM, Alexander Terekhov wrote:
> 
> >
> > Alexander Terekhov wrote:
> >
> > [... asm long atomic_decrement_[weak|strong] ...]
> >
> > I suppose that CodeWarrior is smart enough to recognize the presence
of
> > msync instructions and will behave accordingly with respect to
compiler
> > caching/reordering across these routines. If not, things can go wild,
> > beware.
> 
> Your assumption is correct.  CodeWarrior won't reorder across these
> instructions.
> 
> -Howard
> 
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
 




 19 Posts in Topic:
std::msync
Alexander Terekhov <te  2004-09-20 11:09:20 
Re: std::msync
"SenderX" <x  2004-09-20 18:39:58 
Re: std::msync
"SenderX" <x  2004-09-20 18:42:53 
Re: std::msync
Alexander Terekhov <te  2004-11-04 23:38:31 
Re: std::msync
Alexander Terekhov <te  2005-02-18 13:36:32 
Re: std::msync
Alexander Terekhov <te  2005-03-30 19:24:51 
Re: std::msync
Alexander Terekhov <te  2005-03-31 19:25:40 
Re: std::msync
Alexander Terekhov <te  2005-04-01 00:55:52 
Re: std::msync
Alexander Terekhov <te  2005-04-01 01:11:10 
Re: std::msync
Alexander Terekhov <te  2005-04-01 13:35:46 
Re: std::msync
"Peter Dimov" &  2005-04-02 14:23:01 
Re: std::msync
Alexander Terekhov <te  2005-04-02 17:29:47 
Re: std::msync
Alexander Terekhov <te  2005-04-06 20:58:38 
Re: std::msync
Alexander Terekhov <te  2005-04-06 20:59:48 
Re: std::msync
Alexander Terekhov <te  2005-04-11 13:07:47 
Re: std::msync
"Peter Dimov" &  2005-04-11 14:48:51 
Re: std::msync
Alexander Terekhov <te  2005-04-11 15:01:58 
Re: std::msync
"Peter Dimov" &  2005-04-02 17:43:36 
Re: std::msync
Alexander Terekhov <te  2005-04-02 17:07:04 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 22:57:21 CST 2008.