Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #864

Re: pthread_join crash

From somenathpal@gmail.com
Newsgroups comp.programming.threads
Subject Re: pthread_join crash
Date 2012-05-15 04:03 -0700
Organization http://groups.google.com
Message-ID <8599463.3435.1337079834269.JavaMail.geo-discussion-forums@ynja13> (permalink)
References <9a956a1e-3d3e-4a98-b24b-beae12f40a03@n9g2000pbi.googlegroups.com> <87k40d7nrk.fsf@araminta.anjou.terraraq.org.uk>

Show all headers | View raw


On Tuesday, May 15, 2012 3:46:15 PM UTC+5:30, Richard Kettlewell wrote:
> somenath  writes:
> >      pthread_t thread_id[2];
> >      void *thread_result;
> >      int status;
> > 	 int i =0;
> > 	 while ( i ++ <2) {
> > 		 status = pthread_create (&thread_id[i], NULL, thread_routine,
> > NULL);
> 
> You are writing past the end of thread_id[].
> 
> > 		  printf("\n VAL of i = %d\n");
> 
> You aren't supplying i to printf.  The compiler can spot this for you,
> but you need to turn warnings on.
> 

Many thanks for  the help.

Back to comp.programming.threads | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

pthread_join  crash somenath <somenathpal@gmail.com> - 2012-05-14 20:52 -0700
  Re: pthread_join crash Philip Guenther <guenther@gmail.com> - 2012-05-14 22:56 -0700
    Re: pthread_join crash somenathpal@gmail.com - 2012-05-15 00:28 -0700
      Re: pthread_join crash Arun Chandrasekaran <visionofarun@gmail.com> - 2012-05-15 01:51 -0700
  Re: pthread_join  crash Richard Kettlewell <rjk@greenend.org.uk> - 2012-05-15 11:16 +0100
    Re: pthread_join  crash somenathpal@gmail.com - 2012-05-15 04:03 -0700

csiph-web