#include<stdio.h>#include<stdlib.h>#include<unistd.h>#include<pthread.h>void*tfn(void*arg){int i;i =(int)arg;printf("i am %dth thread,thread_id:%lu\n",i+1,pthread_self());returnNULL;}intmain(){int n=5,i;pthread_t tid;for(i=0;i<n;i++){pthread_create(&tid,NULL,tfn,(void*)i);}printf("i am main thread,thread id:%lu\n",pthread_self());pthread_exit(NULL);}