public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* extend gthr-posix.h with rwlock
@ 2008-06-05 18:02 Luke Dalessandro
  2008-06-05 18:27 ` David Edelsohn
  0 siblings, 1 reply; 5+ messages in thread
From: Luke Dalessandro @ 2008-06-05 18:02 UTC (permalink / raw)
  To: gcc

We have code that fails to scale do to the object_mutex lock in 
unwind-dw2-fde.c. This mutex protects two lists local to the file. The primary 
list is used in "read-mostly" mode, with the secondary list used rarely when 
writing needs to happen.

I am trying to change this locking scheme to use a reader/writer lock (I'd 
prefer something even more scalable, like an RCU style algorithm, or seqlock + 
partially visible reader count, but I don't have time at the moment to do 
anything like that).

I've set up forwarding to pthread_rwlock_t and the corresponding functions in 
gthr-posix.h, just following the template of how pthread_mutex_t is linked in.

My problem is that unwind-dw2-fde.c seems to be compiled multiple times during 
a gcc build, and sometimes my additions are found but other times they are 
not. I am rebuilding again (AIX 5.1), and I'll post more information for 
anyone that needs it.

In the meantime, is there a how-to anywhere that describes adding or modifying 
gthr.h models in gcc?

Thanks,
Luke

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

* Re: extend gthr-posix.h with rwlock
  2008-06-05 18:02 extend gthr-posix.h with rwlock Luke Dalessandro
@ 2008-06-05 18:27 ` David Edelsohn
  2008-06-05 22:41   ` Luke Dalessandro
  0 siblings, 1 reply; 5+ messages in thread
From: David Edelsohn @ 2008-06-05 18:27 UTC (permalink / raw)
  To: Luke Dalessandro; +Cc: gcc

>>>>> Luke Dalessandro writes:

Luke> My problem is that unwind-dw2-fde.c seems to be compiled multiple times during 
Luke> a gcc build, and sometimes my additions are found but other times they are 
Luke> not. I am rebuilding again (AIX 5.1), and I'll post more information for 
Luke> anyone that needs it.

Luke> In the meantime, is there a how-to anywhere that describes adding or modifying 
Luke> gthr.h models in gcc?

	AIX multilibs pthread support.  Unlike Linux, AIX does not provide
weak versions of the pthread symbols when operating in single-threaded
mode.  AIX uses gthr-aix.h, which includes gthr-posix.h or gthr-single.h
depending on the -pthread option.

David

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

* Re: extend gthr-posix.h with rwlock
  2008-06-05 18:27 ` David Edelsohn
@ 2008-06-05 22:41   ` Luke Dalessandro
  2008-06-05 22:59     ` David Edelsohn
  0 siblings, 1 reply; 5+ messages in thread
From: Luke Dalessandro @ 2008-06-05 22:41 UTC (permalink / raw)
  To: David Edelsohn; +Cc: gcc

David Edelsohn wrote:
>>>>>> Luke Dalessandro writes:
> 
> Luke> My problem is that unwind-dw2-fde.c seems to be compiled multiple times during 
> Luke> a gcc build, and sometimes my additions are found but other times they are 
> Luke> not. I am rebuilding again (AIX 5.1), and I'll post more information for 
> Luke> anyone that needs it.
> 
> Luke> In the meantime, is there a how-to anywhere that describes adding or modifying 
> Luke> gthr.h models in gcc?
> 
> 	AIX multilibs pthread support.  Unlike Linux, AIX does not provide
> weak versions of the pthread symbols when operating in single-threaded
> mode.  AIX uses gthr-aix.h, which includes gthr-posix.h or gthr-single.h
> depending on the -pthread option.

Thank you, this was indeed the problem. I added the needed stubbs in 
gthr-single.h and it now compiles fine. Unfortunately there seems to be 
something wrong with my installation of ld as linking fails with a large 
number of errors of the form:

ld: 0711-252 SEVERE ERROR: File auxiliary symbol entry 1 in object _negdi2_s.o:
         Field x_offset contains 4. Valid values are between 4 and -1.
         The object name is being substituted.

Unfortunately I have almost no experience with AIX. I'll look for a prebuilt 
ld that seems newer than mine to see if this helps the problem.

Thank you for your help.

Luke

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

* Re: extend gthr-posix.h with rwlock
  2008-06-05 22:41   ` Luke Dalessandro
@ 2008-06-05 22:59     ` David Edelsohn
  2008-06-06  0:05       ` Luke Dalessandro
  0 siblings, 1 reply; 5+ messages in thread
From: David Edelsohn @ 2008-06-05 22:59 UTC (permalink / raw)
  To: Luke Dalessandro; +Cc: gcc

>>>>> Luke Dalessandro writes:

Luke> Thank you, this was indeed the problem. I added the needed stubbs in 
Luke> gthr-single.h and it now compiles fine. Unfortunately there seems to be 
Luke> something wrong with my installation of ld as linking fails with a large 
Luke> number of errors of the form:

Luke> ld: 0711-252 SEVERE ERROR: File auxiliary symbol entry 1 in object _negdi2_s.o:
Luke> Field x_offset contains 4. Valid values are between 4 and -1.
Luke> The object name is being substituted.

Luke> Unfortunately I have almost no experience with AIX. I'll look for a prebuilt 
Luke> ld that seems newer than mine to see if this helps the problem.

	Pre-built ld?  AIX ships with ld.  Are you using GNU Binutils
(gas, GNU ld, etc.) on AIX?  Please use the native AIX tools (as, ld, nm,
etc.) with AIX as mentioned in the platform-specific installation notes:

http://gcc.gnu.org/install/specific.html#x-ibm-aix

David

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

* Re: extend gthr-posix.h with rwlock
  2008-06-05 22:59     ` David Edelsohn
@ 2008-06-06  0:05       ` Luke Dalessandro
  0 siblings, 0 replies; 5+ messages in thread
From: Luke Dalessandro @ 2008-06-06  0:05 UTC (permalink / raw)
  To: David Edelsohn; +Cc: gcc

David Edelsohn wrote:
>>>>>> Luke Dalessandro writes:
> 
> Luke> Thank you, this was indeed the problem. I added the needed stubbs in 
> Luke> gthr-single.h and it now compiles fine. Unfortunately there seems to be 
> Luke> something wrong with my installation of ld as linking fails with a large 
> Luke> number of errors of the form:
> 
> Luke> ld: 0711-252 SEVERE ERROR: File auxiliary symbol entry 1 in object _negdi2_s.o:
> Luke> Field x_offset contains 4. Valid values are between 4 and -1.
> Luke> The object name is being substituted.
> 
> Luke> Unfortunately I have almost no experience with AIX. I'll look for a prebuilt 
> Luke> ld that seems newer than mine to see if this helps the problem.
> 
> 	Pre-built ld?  AIX ships with ld.  Are you using GNU Binutils
> (gas, GNU ld, etc.) on AIX?  Please use the native AIX tools (as, ld, nm,
> etc.) with AIX as mentioned in the platform-specific installation notes:

No, I'm sorry I wasn't clear. I am using all of the AIX tools, not Binutils. I 
just assumed that there was something out-of-date with the ld that came with 
our AIX 5.1 installation.

> http://gcc.gnu.org/install/specific.html#x-ibm-aix

I have seen this page before, and I'm not sure that it helps me. I'm running 
into the same behavior posted at 
http://gcc.gnu.org/ml/gcc-bugs/2005-04/msg03175.html, where the advice is also 
to look at this page, but there doesn't seem to be a reply from the original 
poster.

Thanks,
Luke

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

end of thread, other threads:[~2008-06-06  0:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-05 18:02 extend gthr-posix.h with rwlock Luke Dalessandro
2008-06-05 18:27 ` David Edelsohn
2008-06-05 22:41   ` Luke Dalessandro
2008-06-05 22:59     ` David Edelsohn
2008-06-06  0:05       ` Luke Dalessandro

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 read-only IMAP folder(s) and NNTP newsgroup(s).