Select the transition that is invalid for the five-state process model with two suspend states:
Select one:
a. Ready/suspend -> Running
b. Ready -> Running
c. Ready/suspend -> Ready
d. Running -> Blocked
e. None of the aboveReady/suspend -> RunningGiven the following code:
void * func(void * pointer)
{
int *int_ptr = (int *) pointer;
for(int i = 0; i < 10; i++)
if (i % 2 != 0 )
*int_ptr = *int_ptr + 2;
return NULL;
}
int main()
{
static int x = 0 ;
pthread_t tid;
pthread_create(&tid, NULL, func, (void *) &x);
pthread_join (tid, NULL);
printf ("X = % d\n", x);
return 0;
}
How many child threads are created by the main thread?1Select the element that is not part of the thread in the multithreaded process model:
Select one:
a. User Stack
b. User Address space
c. None of the above
d. Thread Control Block
e. Kernel StackWhen an interrupt occurs, the program counter value changes to the first address of the interrupt handler.TrueThe principal objective of time sharing is to increase the average response time.FalseIn the five-state process model with one suspend state, virtual memory is used to allocate the processes that are coming from the new state.FalseIn a User-Level Thread implementation, the scheduling at the OS level is based on threads.FalseGiven the following blocks (with their last access time): A (10), B (15), C (9), and D (18). Choose the block that will be selected by LRU to be
replaced:
Select one:
a. A
b. C
c. D
d. Bc.DSelect the transition that is invalid for the five-state process model:
Select one:
a. Ready -> Running
b. Running -> Blocked
c. Ready -> Blocked
d. Blocked -> Ready
e. None of the aboveCIn the POSIX thread implementation, how many times does a parent thread with n child threads should call pthread_join()
Select one:
a. None of the above
b. 1
c. n+1
d. nd.nGiven the following code:
void * func(void * pointer)
{
int *int_ptr = (int *) pointer;
for(int i = 0; i < 10; i++)
if (i % 2 != 0 )
*int_ptr = *int_ptr + 2;
return NULL;
}
int main()
{
static int x = 0 ;
pthread_t tid;
pthread_create(&tid, NULL, func, (void *) &x);
pthread_join (tid, NULL);
printf ("X = % d\n", x);
return 0;
}
Enter the value of the variable x for the instruction printf("X = %d\n", x):10The Program Counter (PC) size determines the number of positions of the memory.TrueA programmed I/O uses interrupts to know the state of the I/O device.falseIn Paging (memory management), processes are comprised of a number of variable-size blocks.falseSelect the component that is a basic element of a computer system:
Select one:
a. Processor
b. Main Memory
c.
I/O Modules
d. System Bus
e. All of the abovee.Select the advantage of an SMP system that is related to fault tolerance:
Select one:
a. Availability
b. Incremental Growth
c. None of the above
d. Scaling
e. PerformanceaSelect the approach of execution of the OS where the OS functions are available in a shared address space for all the user processes:
Select one:
a. None of the above
b. Process-based OS
c. Within User Processes
d. Separate KernelcSelect an advantage of kernel-level threads:
Select one:
a. Scheduling can be application specific
b. Uses a thread library
c. Can take advantage of a multiprocessor platform
d. Threads functions are done in user mode
e. None of the AbovecGiven the following code:
void * func(void * pointer)
{
int *int_ptr = (int *) pointer;
for(int i = 0; i < 6; i++)
if (i % 2 != 0 )
*int_ptr = *int_ptr * 2;
return NULL;
}
int main()
{
static int x = 1 ;
pthread_t tid;
pthread_create(&tid, NULL, func, (void *) &x);
pthread_join (tid, NULL);
printf ("X = % d\n", x);
return 0;
}
How many child threads are created by the main thread?1In a priority scheme to handle multiple interrupts, the system disables the interrupts while an interrupt is being processed.falsewait(0) will suspend the execution of the calling process until information is available for a terminated child process.trueIn the five-state process model, a process in the running state can return to the ready state.trueA multithreaded process with five threads has only one PID.trueIn a User-Level Thread implementation, only one thread of a process can be running at a particular time.trueSelect the memory management responsibility from the OS that prevents independent processes from interfering with each
other's memory:
Select one:
a. Support for modular programming
b. Long term storage
c. Automatic Allocation
d. Process Isolation
e. None of the abovedSelect an advantage of kernel-level threads:
Select one:
a. Uses a thread library
b. Threads functions are done in user mode
c. Can take advantage of a multiprocessor platform
d. None of the Above
e. Scheduling can be application specificc .