linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hendrik Visage <hvjunk@gmail.com>
To: "Joël Krähemann" <weedlight@gmail.com>
Cc: Linux C Programming List <linux-c-programming@vger.kernel.org>
Subject: Re: functional tests for atomic operations
Date: Mon, 13 Apr 2015 08:48:55 +0200	[thread overview]
Message-ID: <CADtGFvmNLrrO3QJf_w9s=yNb_bkqG2pAeiBHwgwyykMMHfhKUA@mail.gmail.com> (raw)
In-Reply-To: <55270D25.9040407@gmail.com>

Hi Joël,

 Atomic operations are by "convention" (and here I'll refer to
Tannebaum etc.) put inside of "critical areas" that you protect with
something like a mutex/semaphore/etc. that provides the needed
concurrency prevention, but needs to be made fine grained, ie. each
variable/operation shared should have it's own mutex/semaphore/etc.

 Atomic operations, as in single instructions, are only really
"guaranteed" at the assembler level for the CPU instruction(s) that
the CPU(s) are able to guarantee atomicity, and
mutexes/semaphores/etc. are implemented using those low level
instructions, to provide you with the needed abstraction without
having to know the specifics of the CPU (ie.
Sparc/x86/Itanium/ARM/PowerPC/etc.). To make it more "intuitive, you
could always abstract the specific atomic updates/operation in a
function call and just declare it inline etc. for performance


On Fri, Apr 10, 2015 at 1:37 AM, Joël Krähemann <weedlight@gmail.com> wrote:
> Hi, earlier me experienced problems by using atomic operations on GNU/Linux.
> Are there functional tests out there me could run? The root case is
> uncertain because there were known issues like unsigned long overflow and
> concurrent read access.
>
> I'm developing a music sequencer and dealing often with threads. For now me
> did a work-around using mutices. But me intend to use atomic operations
> again because it makes more intuitive and simpler.
>
> http://gsequencer.org is hosted on GitHub as
> https://github.com/weedlight/ags-devel
>
> For the grand picture the engine is running and me adjust dial widget to
> modify AgsPort field by atomic operations.
>
> At the moment me tries to bring 0.4.2 version to a successful end, marked as
> stable.
>
> kind regards,
> Joël
>
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2015-04-13  6:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09 23:37 functional tests for atomic operations Joël Krähemann
2015-04-13  6:48 ` Hendrik Visage [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='CADtGFvmNLrrO3QJf_w9s=yNb_bkqG2pAeiBHwgwyykMMHfhKUA@mail.gmail.com' \
    --to=hvjunk@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=weedlight@gmail.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).