Các bậc tiền bối cho em hỏi về pthread với ạ.
E có 2 chương trình:
#include "pthread.h"
int main(){
pthread_t *p = NULL;
p = (pthread_t*)malloc(sizeof(pthread_t));
pthread_create(p,NULL,NULL,NULL);
pthread_join(*p,NULL);
}
#include "pthread.h"
int main(){
pthread_t p;
pthread_create(&p,NULL,NULL,NULL);
pthread_join(p,NULL);
}
cho e hỏi là việc tạo thread = 1 pointer với việc tạo 1 thread bằng 1 variable thì khác nhau như nào ạ. E cám ơn ạ.