Hello !
Let's supose I have a main function in C , and two POSIX threads. I give you an example down :
int main() {
int something;
char else;
void *FirstThread();
void *SecondThread();
..
<start those two pthreads ..>
return 0;}
void *FirstThread() { ... }
void *SecondThread()... (2 Replies)
Hi all,
How can I get the list of all Threads and the Total count of threads under a particular process ?
Do suggest !!
Awaiting for the replies !!
Thanks
Varun:b: (2 Replies)
HI,
When i am configuring php in SUN Solaris. I am getting the below error.
configure: error: Your system seems to lack POSIX threads.
Do i need to install POSIX? If so can somebody let me know where can i download POSIX for Solaris 8?
Thanks, (2 Replies)
I created multiple POSIX threads (on readhat Linux) in a C program in my app. What I am doing is - I am creating threads equal to the number of CPUs in the system and and equal number of instances of a certain data structure, basically a queue implementation. I am assigning one ID to the thread... (2 Replies)
Hi,
I am new to posix threads. The no of threads to be created depends on the runtime. If I get the number of threads,
I need to forward declare
pthread_t mythread;
how to do that can I use pointers and use malloc()??
I also have another question. The pthread_join is used to make... (0 Replies)
I wonder if someone knows what is the rationale behind linking function calls of the POSIX threads library at link-time vs. run-time.
For example, if I create the following program:
#include <pthread.h>
void noop() {
return;
}
int main() {
pthread_self();
pthread_atfork(noop,... (1 Reply)
Hi,
I have a VM with following configration .
3.10.0-693.1.1.el7.x86_64 #1 SMP Thu Aug 3 08:15:31 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
My current POSIX is :--
Your environment variables take up 2011 bytes
POSIX upper limit on argument length (this system): 2093093
POSIX smallest... (15 Replies)
Discussion started by: Abhayman
15 Replies
LEARN ABOUT SUNOS
pthread_attr_setdetachstate
pthread_attr_getdetachstate(3C)pthread_attr_getdetachstate(3C)NAME
pthread_attr_getdetachstate, pthread_attr_setdetachstate - get or set detachstate attribute
SYNOPSIS
cc -mt [ flag... ] file... -lpthread [ library... ]
#include <pthread.h>
int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate);
int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate);
The detachstate attribute controls whether the thread is created in a detached state. If the thread is created detached, then use of the
ID of the newly created thread by the pthread_detach() or pthread_join() function is an error.
The pthread_attr_setdetachstate() and pthread_attr_getdetachstate(), respectively, set and get the detachstate attribute in the attr
object.
The detachstate can be set to either PTHREAD_CREATE_DETACHED or PTHREAD_CREATE_JOINABLE. A value of PTHREAD_CREATE_DETACHED causes all
threads created with attr to be in the detached state, whereas using a value of PTHREAD_CREATE_JOINABLE causes all threads created with
attr to be in the joinable state. The default value of the detachstate attribute is PTHREAD_CREATE_JOINABLE.
Upon successful completion, pthread_attr_setdetachstate() and pthread_attr_getdetachstate() return a value of 0. Otherwise, an error num-
ber is returned to indicate the error.
The pthread_attr_getdetachstate() function stores the value of the detachstate attribute in detachstate if successful.
The pthread_attr_setdetachstate() or pthread_attr_getdetachstate() functions may fail if:
EINVAL attr or detachstate is invalid.
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
pthread_attr_init(3C), pthread_attr_setstackaddr(3C), pthread_attr_setstacksize(3C), pthread_create(3C), attributes(5), standards(5)
23 Mar 2005 pthread_attr_getdetachstate(3C)