linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* functional tests for atomic operations
@ 2015-04-09 23:37 Joël Krähemann
  2015-04-13  6:48 ` Hendrik Visage
  0 siblings, 1 reply; 2+ messages in thread
From: Joël Krähemann @ 2015-04-09 23:37 UTC (permalink / raw)
  To: linux-c-programming

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

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

* Re: functional tests for atomic operations
  2015-04-09 23:37 functional tests for atomic operations Joël Krähemann
@ 2015-04-13  6:48 ` Hendrik Visage
  0 siblings, 0 replies; 2+ messages in thread
From: Hendrik Visage @ 2015-04-13  6:48 UTC (permalink / raw)
  To: Joël Krähemann; +Cc: Linux C Programming List

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

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

end of thread, other threads:[~2015-04-13  6:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-09 23:37 functional tests for atomic operations Joël Krähemann
2015-04-13  6:48 ` Hendrik Visage

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