Home > pthread setspecific error > pthread_setspecific error 22

Pthread_setspecific Error 22

Contents

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this

Pthread_setspecific Example

site About Us Learn more about Stack Overflow the company Business Learn pthread_getspecific example more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question pthread_key_create x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Difficulty

Pthread Error Codes

Creating Pthreads (Error 22) up vote 0 down vote favorite Learning about pthreads, but I'm having trouble getting them created. Here is my output and the gdb information: In main(), creating thread 1 ERROR: return code from pthread_create() is 22 for thread 1 In main(), creating thread 2 ERROR: return code from pthread_create() is 22 for thread 2 In main(), creating thread 3 ERROR:

Pthread_key_t

return code from pthread_create() is 22 for thread 3 In main(), creating thread 4 ERROR: return code from pthread_create() is 22 for thread 4 In main(), creating thread 5 ERROR: return code from pthread_create() is 22 for thread 5 Program received signal SIGSEGV, Segmentation fault. 0xb7fb4d8a in pthread_join (threadid=76038327, thread_return=0x0) at pthread_join.c:46 46 pthread_join.c: No such file or directory. And here is my code: #include #include #include #include #include #include #define SBUFSIZE 1025 char errorstr[SBUFSIZE]; FILE* inputfp[5]; void* f(void* inpFile) { fprintf(stderr, "%s\n", (char*)inpFile); return NULL; } int main (int argc, char* argv[]) { int i; /* Thread Variables */ pthread_attr_t attr; pthread_t *th[argc-2]; //one thread for each input file /* allocate memory for the threads */ for (i = 0; i < (argc-2); i++) { th[i] = (pthread_t *) malloc(sizeof(pthread_t)); inputfp[i] = fopen(argv[i], "r"); if (!inputfp[i]) { sprintf(errorstr, "Error Opening Input File: %s", argv[i]); perror(errorstr); } } /* Create one thread for each input file */ for (i = 1; i < (argc - 1); i++) { fprintf (stderr, "In main(), creating thread %1d\n", i); int rc = pthread_create (th[i], &attr,

First | Previous | Next | Last ] By Author: [ First | Previous | Next | https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=STARDEV;9b88958.0907 Last ] Font: Proportional Font LISTSERV Archives STARDEV Home STARDEV July 2009 Options Subscribe or Unsubscribe Log In Get Password Subject: Re: starjava and OSX From: David Berry <[log in to unmask]> Reply-To:Starlink development <[log in to unmask]> Date:Wed, 15 Jul 2009 09:57:24 +0100 Content-Type:text/plain Parts/Attachments: text/plain (28 lines) Mark, Not sure pthread_setspecific error if this is coming out of AST or JNIAST. Error 22 from pthread_setspecific appears to mean an invalid key has been supplied. Does pthread_setspecific get called from anywhere inside JNIAST? The stuff in AST that calls pthreads routines reports errors directly to stderr using fprintf. Can output to stderr be retrieved in any pthread_setspecific error 22 way? David 2009/7/15 Tim Jenness <[log in to unmask]>: > JNIAST doesn't work at all for me on OSX 64-bit. > > java.lang.Error: pthread_setspecific error 22 >        at uk.ac.starlink.ast.UnitMap.construct(Native Method) >        at uk.ac.starlink.ast.UnitMap.(UnitMap.java:46) >        at uk.ac.starlink.ast.AstPackage.isAvailable(AstPackage.java:36) >        at uk.ac.starlink.splat.ast.ASTJ.isAvailable(ASTJ.java:126) > > were we expecting that? This is from rebuilt JNIAST library. The previous > build from 3 months ago worked fine. > > -- > Tim Jenness > Joint Astronomy Centre > Top of Message | Previous Page | Permalink JiscMail Tools Files Area | help RSS Feeds and Sharing RSS 1.0 feed RSS 2.0 feed Atom feed Search Archives Advanced Options Archives October 2016September 2016August 2016July 2016May 2016April 2016March 2016February 2016January 2016December 2015October 2015September 2015August 2015April 2015March 2015February 2015January 2015December 2014November 2014October 2014September 2014August 2014July 2014June 2014May 2014April 2014March 2014February 2014January 2014December 2013November 2013October 2013September 2013August 2013July 2013June 2013May 2013April 2013March 2013February 2013Januar

 

Related content

No related pages.