Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <pthread.h>
- void* hello (void* tid ) {
- printf ("Hello␣from␣thread␣%d\n" , (int) tid ) ;
- }
- int main() {
- pthread_t tid [ 10 ] ;
- int i ;
- for ( i = 0; i < 10; i++) {
- pthread_create(&tid[i] , NULL, hello , (void*)i ) ;
- }
- pthread_exit (NULL) ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement