[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

threads and latest libg++?

Are the latest libg++ and threads happy together?  I have libg++272 version installed, and I'm running mostly libc6 stuff.

Here's my program, reduced to illustrate the problem precisely.

[ begin program ]

#include <pthread.h>
#include <iostream.h>
#include <unistd.h>
#include <assert.h>

#define THREADS 10

main() {
  pthread_t t[THREADS];
  void *retval;
  int i;
  pthread_attr_t thread_attributes;
  assert( pthread_attr_init( &thread_attributes ) == 0 );

  cout << "exiting" << endl;

[ end program ]

If I compile this "g++ thread.cc", it prints exiting.  No problem.  If I
simply compile this, unchanged, but say "g++ thread.cc -lpthread", it
immediately segfaults.  The reasons I suspect libg++:
1) Get rid of iostream.h and cout replace with stdio.h and printf, and I 
   can use threads to my hearts content.
2) The new version of libg++ has the new libio stuff in it, right?  So,
   maybe there is a problem in there?


+--------------------  finger for pgp public key  ---------------------+
| Dale E. Martin | University of Cincinnati Savant Research Laboratory |
| dmartin@ececs.uc.edu    |     http://www.ececs.uc.edu/~dmartin       |

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .

Reply to: