Download pdf - Scheduling algo

Transcript
  • File: /home/shivam/Desktop/os/Practicals/11.cpp Page 1 of 1

    /* Program 11- Write program to calculate sum of n even numbers using thread library. */

    #include#include#includeusing namespace std;

    int sum;void *summation(void *p);

    int main(int argc, char *argv[]){ pthread_t tid; pthread_create(&tid,NULL,summation,argv[1]); pthread_join(tid,NULL); cout