Re: [linux-sh:03198] Atomic operations from user-space?

Dan Kegel <[email protected]> Fri, 02 Apr 2004 08:41:11 -0800
Newsgroups gmane.linux.ports.sh.devel,gmane.linux.ports.sh.general
Message-ID <[email protected]>
Alex Bennee wrote:
> I'm trying to debug some mutex code (or more correctly work around some
> of glibc's mutex breakages with real-time scheduling). However I'd like
> to do some reference counting and I can't think of a good way to do it
> in user space.
> 
> glib-2.4.0 seems to promise atomic operations but a) I can't get it to
> build for sh and b) looking at the code it seems to use mutex's for
> arch's it doesn't explicitly support.
> 
> Anyone got any ideas?


gcc comes with atomic operations in libstdc++ that might be handy;
see <bits/atomicity.h>.
(On my workstation, it's /usr/include/c++/3.2.2/i386-redhat-linux/bits/atomicity.h
so don't be surprised if it's not obviously visible in /usr/include)

I'm not familiar with the breakages you mention.  Can
you give me a link to where they're discussed?

Also, have you looked in glibc's bug tracking system for
a bug report about the locking problems you mention?
If not, please do, and file a bug if you don't find one.
- Dan

-- 
My technical stuff: http://kegel.com
My politics: see http://www.misleader.org for examples of why I'm for regime change


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click