Select the correct option to test your answer:
Computer Science Engineering
Linux
Difficulty: Medium
What is the output of this program? #include<stdio.h> #include<pthread.h> #include<semaphore.h> void *fun_t(void *arg); void *fun_t(void *arg) { sem_post(&st); pthread_exit("Bye"); } int main() { pthread_t pt; sem_t st; void *res_t; if(pthread_create(&pt,NULL,fun_t,NULL) == -1) perror("pthread_create"); if(sem_init(&st,0,0) != 0) perror("sem_init"); if(sem_wait(&st) != 0) perror("sem_wait"); printf("Example\n"); if(pthread_join(pt,&res_t) == -1) perror("pthread_join"); if(sem_destroy(&st) != 0) perror("sem_destroy"); return 0; }
More Computer Science Engineering Questions
A _____ is an outline of a process that keeps develop successful information systems
Which one of these is a tree based learner?
Knowledge may be I. Declarative. II. Procedural. III. Non-procedural.
Which of the following extensions suggest that the file is a backup copy.
Procedural cohesion is similar to sequential cohesion, except that with procedural cohesion _____