Could anybody explain step by step why such arguments ( NULL pointer(s) ) when calling pthread_create like this:
pthread_create(&id_thread1,NULL,thread1,NULL);
result in default attributes for the thread1 ?
I know that pthread.h file is a key factor here.
But unfortunately I do not understand why; the code is way too sophisticated to me.
Thanks in advance!
The signature to
pthread_createis:The second argument is a
pthread_attr_t*pointer. This allows you to set various attributes of the thread, such as scheduling policy or thread stack-size, using apthread_attr_tobject. IfattrisNULLthen default attributes are used.The fourth argument is simply a
void*pointer that can point to any arbitrary user data to be passed tostart_routinewhen the thread begins. IfargisNULLthen a null pointer is passed.