public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* MT-safe exception and thread library
@ 1997-12-16 12:25 H.J. Lu
  1997-12-17  1:11 ` Teemu Torma
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: H.J. Lu @ 1997-12-16 12:25 UTC (permalink / raw)
  To: egcs; +Cc: GNU C Library

I am glad to see the Thread-safe EH support in egcs 971215. There is
already configure support for thread in libobjc.a. Can libgcc also use
it also? Basically, configure defines "thread_file", which can be
single, posix, mach, win32, solaris, irix. It shouldn't be hard to
add DCE. libgcc-thr.h can be linked to libgcc-$thread_file.h
so that --enable-threads will enable the Thread-safe EH support
and set the right thread file.

I am not sure if I like the multilibs for the Thread-safe EH support.
That may be a problem for glibc. I'd like to see an option for a
single libgcc.a with the the Thread-safe EH support using weak
symols. I think it should work with gcc on platforms with weak
support. We can use SUPPORTS_WEAK to detect it. It should be
very easy to do.

Thanks.

-- 
H.J. Lu (hjl@gnu.org)

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: MT-safe exception and thread library
@ 1997-12-20  7:08 Andrew Zabolotny
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Zabolotny @ 1997-12-20  7:08 UTC (permalink / raw)
  To: egcs

On Wed, 17 Dec 1997 13:48:26 +0100, Teemu Torma wrote:

>    One more thing: the flag.  How about -fthreads instead of -threads?
>And what if there are multiple thread libraries?  There are, at
>least in Solaris 2.5.  
I'm not sure if this is applicable, but OS/2 resolves this following way
(since `93 or `94):
In target makefile fragment:
# Allow multi-threaded/single-threaded libraries
MULTILIB_OPTIONS    = Zmt
MULTILIB_DIRNAMES   = mt st
MULTILIB_MATCHES    = Zmt=Zmts Zmt=Zmtd
MULTILIB_EXCEPTIONS =
MULTILIB_EXTRA_OPTS =

and with a few changes to
-----------------------------------------------------------
diff -rcwB pgcc-1.0/gcc/genmultilib pgcc-1.0-emx/gcc/genmultilib
*** pgcc-1.0/gcc/genmultilib	Mon Aug 11 18:57:08 1997
--- pgcc-1.0-emx/gcc/genmultilib	Mon Dec  8 23:08:38 1997
***************
*** 35,40 ****
--- 35,43 ----
  # elements in the second list are separated by spaces.  If the second
  # argument is empty, the option names will be used as the directory
  # names.
+ # If number of elements in second argument is bigger than number of
options
+ # in the first argument, the n+1'th element is used as default directory
+ # name (i.e. when no one of options specified in argument 1 was used)
  
  # The optional third argument is a list of options which are
  # identical.  The elements in the list are separated by spaces.  Each
***************
*** 164,169 ****
--- 167,178 ----
    done
  fi
  
+ # See if default directory was specified
+ if [ -n "$1" ]; then
+   defaultdir="$1"
+ else
+   defaultdir="."
+ fi
  # We need another recursive shell script to correctly handle positive
  # matches.  If we are invoked as
  #   genmultilib "opt1 opt2" "" "opt1=nopt1 opt2=nopt2"
***************
*** 203,209 ****
    done
  done
  optout=`echo ${optout} | sed -e 's/^ //'`
! echo "\". ${optout};\","
  
  # Work over the list of combinations.  We have to translate each one
  # to use the directory names rather than the option names, we have to
--- 212,218 ----
    done
  done
  optout=`echo ${optout} | sed -e 's/^ //'`
! echo "\"${defaultdir} ${optout};\","
  
  # Work over the list of combinations.  We have to translate each one
  # to use the directory names rather than the option names, we have to
-----------------------------the end----------------------------

It also would be nice to define some symbol (OS/2 defines __MT__ -- are
there other standards? If yes, it would be The Right Thing {tm} to define
some unique symbol everywhere (on all platforms), and all other symbols
depending on target platform) when using -mthreads (this is needed, for
example C headers checks it for a thread-aware errno). And it looks stupid
to me to make three (four counting OS/2`s -Zmt/-Zst) different switches
for same thing - producing a threaded program. There should be only one
switch, I think -fthreads looks best. I think this switch should be
unified ASAP, since later changing the switch may affect much more
makefiles.

>pthread library.  Similiary, -threads would do the same thing with 
>a platform-specific threads library.  
-fthreads should define the preprocessor symbol and link agains
thread-aware C libraries, the thread library itself
can be as well linked with something like -lthreads.

Greetings,
    _\ndy@teamOS/2


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

end of thread, other threads:[~1997-12-20  7:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-16 12:25 MT-safe exception and thread library H.J. Lu
1997-12-17  1:11 ` Teemu Torma
1997-12-17  4:30   ` Andrey Slepuhin
1997-12-17  6:10   ` Ulrich Drepper
     [not found] ` <199712170910.KAA25862.cygnus.egcs@baht.labs.trema.com>
1997-12-17  2:52   ` Jason Merrill
1997-12-17  4:48     ` Teemu Torma
1997-12-17  4:59     ` Andrey Slepuhin
1997-12-17 10:10 ` Teemu Torma
1997-12-17  8:57   ` H.J. Lu
1997-12-20  7:08 Andrew Zabolotny

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