Professional Documents
Culture Documents
Student ID: Mc160200011 Course: CS 604 Student Name: Muhammad Awais Khalid
Student ID: Mc160200011 Course: CS 604 Student Name: Muhammad Awais Khalid
Course: CS 604
Student Name: Muhammad Awais Khalid
2:
Following is the code which I use to write the program to display information
#include<stdio.h>
#include<string.h>
#include<pthread.h>
#include<stdlib.h>
#include<unistd.h>
#include <sys/types.h>
pthread_t tid[3];
unsigned long i = 0;
pthread_t id = pthread_self();
if(pthread_equal(id,tid[0]))
{
}else if(pthread_equal(id,tid[1]))
printf("\nCS604\nOperating System\n");
}else if (pthread_equal(id,tid[2])){
for(i=0; i<(0xFFFFFFFF);i++);
return NULL;
int main(void)
int i = 0;
while(i < 3)
i++;
while(i < 3)
{
pthread_join(tid[i], NULL);
i++;
sleep(5);
return 0;