[omniORB] Significance of --enable-threads for building egcs-1.1

Shinji Suzuki suzuki@wni.co.jp
Tue, 27 Oct 1998 14:05:52 +0900


Hi all,
I'm using RedHat 5.1 with egcs-1.1b (compiled without --enable-threads)
on an P5/90. I don't see core dump from the test program Sai-Lai has
posed.

A problem I'm observing is that the following program aborts after
creating about (1024 - 2) threads. I tried creating thread calling
pthread library directly and it does not seem to be affected.
Before delving into source code, I would like to hear from others
of their experiences.

-shinji

#include <iostream.h>
#include <omnithread.h>

static int i;
void * here(void *)
{
  return  (void *)i++;
}

int main(int,char **)
{
  int i = 0;
  for(;;) {
    omni_thread * p = omni_thread::create(here, 0);
    cout << i++ << ':';
    void * r;
    p->join( &r );
    cout << (int) r << endl;
  }
}

> To: "Oliver M. Kellogg" <Oliver.Kellogg@vs.dasa.de>
> From: Sai-Lai Lo <S.Lo@orl.co.uk>
> You can try and see if it generates different code if --enable-threads is
> not specified.
> 
> My experience with some egcs snapshots close to egcs-1.1 is that without
> --enable-threads, mt code generated with egcs on alpha linux just core
> dump. On x86 linux and without --enable-threads, the binary core dumps at
> the first run and not in the second run immediately afterwards.
> 
> If you are interested, try this simple test:
[test program deleted]