Top 150+ Solved Muli-core Architectures and Programming MCQ Questions Answer
Q. What are Spinlocks?
a. CPU cycles wasting locks over critical sections of programs
b. Locks that avoid time wastage in context switches
c. Locks that work better on multiprocessor systems
d. All of the mentioned
Q. What is the main disadvantage of spinlocks?
a. they are not sufficient for many process
b. they require busy waiting
c. they are unreliable sometimes
d. they are too complex for programmers
Q. The signal operation of the semaphore basically works on the basic _______system call.
a. continue()
b. wakeup()
c. getup()
d. start()
Q. If the semaphore value is negative ____________.
a. its magnitude is the number of processes waiting on that semaphore
b. it is invalid
c. no operation can be further performed on it until the signal operation is performed on it
d. none of the mentioned
Q. Which directive must precede the directive: #pragma omp sections (not necessarily immediately)?
a. #pragma omp section
b. #pragma omp parallel
c. None
d. #pragma omp master
Q. When compiling an OpenMP program with gcc, what flag must be included?
a. -fopenmp
b. #pragma omp parallel
c. –o hello
d. ./openmp
Q. Within a parallel region, declared variables are by default ________ .
a. Private
b. Local
c. Loco
d. Shared
Q. A ______________ construct by itself creates a “single program multiple data”program, i.e., each thread executes the same code.
a. Parallel
b. Section
c. Single
d. Master
Q. _______________ specifies that the iteration of the loop must be executed asthey would be in serial program.
a. Nowait
b. Ordered
c. Collapse
d. for loops
Q. ___________________ initializes each private copy with the corresponding valuefrom the master thread.
a. Firstprivate
b. lastprivate
c. nowait
d. Private (OpenMP) and reduction.
Q. The __________________ of a parallel region extends the lexical extent by thecode of functions that are called (directly or indirectly) from within the parallel region.
a. Lexical extent
b. Static extent
c. Dynamic extent
d. None of the above
Q. The ______________ specifies that the iterations of the for loop should beexecuted in parallel by multiple threads.
a. Sections construct
b. for pragma
c. Single construct
d. Parallel for construct
Q. _______________ Function returns the number of threads that are currentlyactive in the parallel section region.
a. omp_get_num_procs ( )
b. omp_get_num_threads ( )
c. omp_get_thread_num ( )
d. omp_set_num_threads ( )
Q. The size of the initial chunksize _____________.
a. total_no_of_iterations / max_threads
b. total_no_of_remaining_iterations / max_threads
c. total_no_of_iterations / No_threads
d. total_no_of_remaining_iterations / No_threads
Q. A ____________ in OpenMP is just some text that modifies a directive.
a. data environment
b. clause
c. task
d. Master thread