Search
 
SCRIPT & CODE EXAMPLE
 

C

thread in c

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>  //Header file for sleep(). man 3 sleep for details.
#include <pthread.h>
  
// A normal C function that is executed as a thread 
// when its name is specified in pthread_create()
void *myThreadFun(void *vargp)
{
    sleep(1);
    printf("Printing GeeksQuiz from Thread 
");
    return NULL;
}
   
int main()
{
    pthread_t thread_id;
    printf("Before Thread
");
    pthread_create(&thread_id, NULL, myThreadFun, NULL);
    pthread_join(thread_id, NULL);
    printf("After Thread
");
    exit(0);
}
Comment

threads in c

pthread_join(p_thread* id, void** return_value);
Comment

PREVIOUS NEXT
Code Example
C :: arduino client disconnect 
C :: Successeur récurssive 
C :: for loop c 
C :: add 2 numbers in c 
C :: graphics in c 
C :: convert number to string c 
C :: clrscr in c 
C :: linear search program in c 
C :: concatenate char * c 
C :: how to sleep in c 
C :: c style array 
C :: scanf string in c 
C :: c program to find minimum of 4 numbers using conditional operator in c 
C :: sum average min max in c array 
C :: Syntax To Take Input In C 
C :: factorial of a number in c 
C :: what is syntax in programming 
C :: how to get the ascii value of a character in c 
C :: replacing a character in string in C 
C :: convert c program to assembly language online 
C :: flip exis in dataframe 
C :: declare variables arduino 
C :: how to change background color in c programming 
C :: c print 2d array 
:: C program to input the month number and output the month name using switch statement 
C :: c program to find minimum of 5 numbers using conditional operator in c 
C :: vifm preview images 
C :: C# special character display 
C :: size of float in c 
C :: national festivals of india in hindi 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =