Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *OS Lab 5
- *11/8/2015
- *Tanmay Naik
- */
- /*---------------------*/
- //basic thread
- #include<stdio.h>
- #include<stdlib.h>
- #include<pthread.h>
- void *f(void *);
- int main()
- {
- pthread_t t1,t2;
- char *m1="Hello";
- char *m2="Hi";
- pthread_create(&t1,NULL,f,(void*)m1);
- pthread_create(&t2,NULL,f,(void*)m2);
- pthread_join(t1,NULL);
- pthread_join(t2,NULL);
- return 0;
- }
- void *f(void *m)
- {
- printf("\n%s",(char*)m);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement