Pthread Join Error 35
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 site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question 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 Does the pthreads functions set the errno internally? up vote 2 down vote favorite 1 In the below code i am calling pthread_join() with thread id as self. Result is that it returns error number 35. So same i am trying to print with perror. But it is displaying "success". My doubt is does library/system calls need to explictly set the errno for any errors or Did i miss any thing ? #include
join another thread without waiting Synopsis #include
(void *arg), void *arg); GeneralDescription Creates a new thread within a process, with attributes defined by the thread attribute object, attr, that is created by pthread_attr_init(). If attr is NULL, the default attributes are used. See "pthread_attr_init()-- Initialize a Thread Attribute Object" in topic 4.1.17 for a description of the thread attributes and their defaults. If the attributes specified by attr are changed later, the thread's attributes are not affected. pthread_t is the data type used to uniquely identify a thread. It is returned by pthread_create() and used by the application in function calls that require a thread identifier. The thread is created running start_routine, with arg as the only argument. If pthread_create() completes successfully, thread will contain the ID of the created thread. If it fails, no new thread is created, and the contents of the location referenced by thread are undefined. System default for the thread limit in a process is set by MAXTHREADS in the BPXPRMxx parmlib member. The maximum number of threads is dependent upon the size of the private area below 16M. pthread_create() inspects this address space prior to creating a new thread. A realistic limit is 200 to 400 threads. SpecialBehaviorforC++ Because C and C++ linkage conventions are incompatible, pthread_create() cannot receive a C++ function pointer as the start routine function pointer If you attempt to pass a C++ function pointer to pthread_create(), the compiler will flag it as an error. You can pass a C or C++ function to pthread_create() by declaring it as extern "C". The started thread provides a boundary with respect to the scope of try-throw-catch processing. A throw done in the start routine or a function called by the start routine causes stack unwinding up to and including the start routine (or until caught). The stack unwinding will not go beyond the start routine back into the thread creator. If the exception is not caught, terminate() is called. The exception stack (for try-throw-catch) are thread-based. The throw of a condition, or re-throw of a condition by a thread does not affect exception processing on another thread, unless the condition is not caught. ReturnedValue If successful, pthread_create() returns the value 0.