Functions for atomic operation.

Discussion in 'C Programming' started by Srinu, Sep 30, 2009.

  1. Srinu

    Srinu Guest

    Dear All,

    Is there any functions available in standard C library or in the
    library that comes with gcc, which can do atomic increaments and
    atomic decrements? (other atomic operations optional... though highly
    preferable...)

    for example, functions like this:

    atomic_inc();
    atomic_dec();

    so that for such small operations user need not write its own
    functions using semaphore or mutex. This could be handy while
    programming for parallel processes or threads.

    Thanks
    Srinu
     
    Srinu, Sep 30, 2009
    #1
    1. Advertising

  2. On 30 Sep, 06:10, Srinu <> wrote:

    > Is there any functions available in standard C library or in the
    > library that comes with gcc, which can do atomic increaments and
    > atomic decrements?


    <snip>

    there is no way to do this in standard C. You need to ask in a gcc
    group (or maybe posix, or amybe...)
     
    Nick Keighley, Sep 30, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sumukh
    Replies:
    8
    Views:
    3,241
    Roedy Green
    Sep 23, 2005
  2. Kashish
    Replies:
    1
    Views:
    354
    msalters
    May 27, 2005
  3. Paul Moore
    Replies:
    5
    Views:
    331
    Parzival
    Nov 15, 2003
  4. Atomic Operation

    , Aug 27, 2006, in forum: Java
    Replies:
    3
    Views:
    469
  5. Charles Oliver Nutter

    [ANN] atomic 0.0.1 - An atomic reference for Ruby

    Charles Oliver Nutter, Jun 8, 2010, in forum: Ruby
    Replies:
    5
    Views:
    263
    Robert Dober
    Jun 8, 2010
Loading...

Share This Page