fork(3) download
  1. #include <stdio.h>
  2. #include<pthread.h>
  3.  
  4.  
  5. void* show(void * u){
  6. printf("this is child process\n");
  7. }
  8.  
  9. int main()
  10. {
  11. pthread_t tid;
  12. pthread_create(&tid,NULL,&show,NULL);
  13. printf("in the main thread\n");
  14. pthread_join(tid,NULL);
  15. printf("complete all the things \n");
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5408KB
stdin
Standard input is empty
stdout
in the main thread
this is child process
complete all the things