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

Shinji Suzuki suzuki@wni.co.jp
Tue, 27 Oct 1998 21:27:50 +0900


>Look under /usr/src/linux/include/tasks.h
>There is a value NR_TASKS or something which specifies the max tasks you can
>have.
>Note that linuxthreads are lightweight processes!
>Also worth looking at is the amount of stack allocated by each thread.

James,

Thanks for your advice. I must be overlooking something but
I think the primary thread in that program joins with a newly
created thread before creating another, which means that
hitting process table size limit is unlikely because at most
only one newly created thread exists at a given time.

-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;
  }
}