#include #include void* run (void* arg){ printf("Hello from run\n"); return NULL; } int main(){ pthread_t thread; pthread_create(&thread, NULL, &run, NULL); pthread_detach(thread); // This command will make thread detached. This means the resources will be released // upon the thread's completion - calling return // However, detached threads cannot be joined, which means if you care about the result // of the thread execution - you should not be using pthread_detach printf("In main"); return 0; }