You are on page 1of 59

Quiz 1:

In the Unix/Linux system, a process can kill itself without any OS intervention.

Select one:
True
False
Feedback

The correct answer is 'False'.

Question 2
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

A new PCB is created on every successful execution of every fork system call

Select one:
True
False
Feedback

The correct answer is 'True'.

Question 3
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

Which of the following statement is false regarding the lifetime of a process?

Select one:
A process is created only when CPU is executing in the kernel-mode
A process is terminated only when the CPU is executing in the kernel-mode
A process can not enter waiting state while executing a system call
A process may be terminated without making the exit() system call
Feedback

Your answer is incorrect.


The correct answer is: A process can not enter waiting state while executing a system call

Question 4
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

Select one:
virtual address from the heap and virtual address from the heap
virtual address from the stack and virtual address from the stack
virtual address from the heap and virtual address from the stack
none of the above
Feedback

Your answer is incorrect.


The correct answer is: virtual address from the heap and virtual address from the stack

Question 5
Correct
Mark 1.00 out of 1.00
Flag question

Question text

Two processes P1 and P2 invoke the malloc library call to allocate one kilobyte each. Which
of the following statements is true?

Select one:
The free physical memory in the system will be reduced by at least two kilobytes.
The free virtual memory in the process address space for P1 will be reduced by one kilobyte.
The free virtual memory in the process address space for P1 will be reduced by at least one
kilobyte.
None of the above
Feedback

Your answer is correct.


The correct answer is: None of the above

Question 6
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text
Consider the following program in the UNIX/Linux OS.

Select one or more:


It will print “sum = 1” infinitely
All output printed are by child processes only
The process that starts the execution of the main function never prints any output
Minimum number of PCBs used anytime during the execution of the above program is one
Maximum number of PCBs used anytime during the execution of the above program is two
Feedback

Your answer is incorrect.


The correct answers are: It will print “sum = 1” infinitely, All output printed are by child
processes only, The process that starts the execution of the main function never prints any
output, Minimum number of PCBs used anytime during the execution of the above program
is one

Question 7
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text

Which of the following statement(s) is are false assuming a Linux like OS with no
vulnerabilities?

Select one or more:


The OS can be crashed from user space by making different combination of system calls
The OS can be crashed from user space by passing invalid arguments while invoking system
calls
The OS can be crashed because of a malicious I/O device
The OS can be crashed by mounting DoS attacks (e.g., allocating huge amount of memory)
The OS can be crashed by a remote host by sending malformed network packets
Feedback

Your answer is incorrect.


The correct answers are: The OS can be crashed from user space by making different
combination of system calls, The OS can be crashed from user space by passing invalid
arguments while invoking system calls, The OS can be crashed by mounting DoS attacks
(e.g., allocating huge amount of memory), The OS can be crashed by a remote host by
sending malformed network packets

Question 8
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text

Which of the following standard C library calls will never invoke any system call?

Select one or more:


strlen
strcpy
sleep
atoi
sprintf
Feedback

Your answer is incorrect.


The correct answers are: strlen, strcpy, atoi, sprintf

Question 9
Incorrect
Mark 0.00 out of 3.00
Flag question

Question text

Select one or more:


The file position for the file represented by ‘fd’ in the parent process will be at 32 when the
parent process terminates.
The file position for the file represented by ‘fd’ in the child process will be at 32 when the
child process terminates.
The file position for the file represented by ‘fd’ in the child process will be at 48 when the
child process terminates.
The file position for the file represented by ‘fd’ in the parent process will be at 48 when the
child process terminates
The ‘fd’ value passed in the last read system call will be same as the ‘fd’ value returned in the
first open system call.
Feedback

Your answer is incorrect.


The correct answers are: The file position for the file represented by ‘fd’ in the parent
process will be at 32 when the parent process terminates., The file position for the file
represented by ‘fd’ in the child process will be at 32 when the child process terminates.

Question 10
Incorrect
Mark 0.00 out of 3.00
Flag question

Question text

Select one or more:


The printf at P1 and C1 may print the same address
The program may execute without causing any segmentation fault
Statement at A1 will cause a segmentation fault for both the processes
Statement at A1 will cause a segmentation fault for the parent process
Statement at A1 will cause a segmentation fault for the child process
Feedback

Your answer is incorrect.


The correct answers are: The printf at P1 and C1 may print the same address, Statement at
A1 will cause a segmentation fault for the child process
Quiz 2

Started on Sunday, 5 February 2023, 7:56 PM


State Finished
Completed on Sunday, 5 February 2023, 8:26 PM
Time taken 29 mins 41 secs
Grade 2.00 out of 20.00 (10%)
Question 1
Correct
Mark 1.00 out of 1.00

Flag question

Question text

By default, all open file descriptors remain open across the exec family of system calls.

Select one:
True
False
Feedback

The correct answer is 'True'.

Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text

Two different system calls can have same system call number in the Unix/Linux System.

Select one:
True
False
Feedback
The correct answer is 'False'.

Question 3
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

The number of arguments passed to the OS from the user space when invoking the 1 seek
system call is

Select one:
2
3
4
5
Feedback

Your answer is incorrect.


The correct answer is: 4

Question 4
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

Select one:
The PID of the process executing L1 and L2 will be the same
The PID of the process executing L1 and all input/output operations of ls will be the same
The PID of the process executing L1 and all input/output operations of ls will be different
None of the above
Feedback

Your answer is incorrect.


The correct answer is: The PID of the process executing L1 and all input/output operations
of ls will be the same

Question 5
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

If the first argument passed to the open system call in the Unix/Linux system is passed as
NULL from any user process P, then,

Select one or more:


P will terminate because of a SEGFAULT.
The OS will terminate P
The OS will crash
None of the above
Feedback

Your answer is incorrect.


The correct answer is: None of the above

Question 6
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text
Which of the following statement(s) is/are true in the Linux/Unix system? The second
argument of the read system call can be

Select one or more:


an address from the program stack segment
an address from the code segment
an address from the program initialized data segment
an address from the program uninitialized data segment
an address from the dynamically allocated data segment
Feedback

Your answer is incorrect.


The correct answers are: an address from the program stack segment, an address from the
program initialized data segment, an address from the program uninitialized data segment,
an address from the dynamically allocated data segment

Question 7
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text

Which of the following system call(s) may manipulate or query the file related information
for any given process?

Select one or more:


open
read
write
1seek
dup
Feedback

Your answer is incorrect.


The correct answers are: open, read, write, 1seek, dup

Question 8
Incorrect
Mark 0.00 out of 3.00
Flag question

Question text

Select one or more:


The number of file objects used in the OS for the file xyz.txt when the process execution
reaches L1 is three.
The number of file objects used in the OS for the file xyz.txt when the process execution
reaches L1 is one.
The number of FDs pointing to the file object associated with xyz.txt at L1 is three.
At L1, the offset for file(s) represented by all file descriptors (fd, fd1 and fd2) will be 48.
At L1, the offset for file(s) represented by fd, fd1 and fd2 will be 16, 32, 48, respectively.
Feedback

Your answer is incorrect.


The correct answers are: The number of file objects used in the OS for the file xyz.txt when
the process execution reaches L1 is one., The number of FDs pointing to the file object
associated with xyz.txt at L1 is three., At L1, the offset for file(s) represented by all file
descriptors (fd, fd1 and fd2) will be 48.

Question 9
Incorrect
Mark 0.00 out of 3.00
Flag question

Question text

Which of the following statement(s) is/are true regarding system call handler
implementation in the Unix/Linux System?

Select one or more:


The OS may read the user stack region in the system call handler
The OS may write to the user stack region in the system call handler
The OS may read the user heap region in the system call handler
The OS may write to the user heap region in the system call handler
The OS may deschedule the process
Feedback

Your answer is incorrect.


The correct answers are: The OS may read the user stack region in the system call handler,
The OS may write to the user stack region in the system call handler, The OS may read the
user heap region in the system call handler, The OS may write to the user heap region in the
system call handler, The OS may deschedule the process

Question 10
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text
Which of the following option(s) is/are correct regarding the behavior of the software
during the execution of the above program?

Select one or more:


The above function can corrupt the user stack
The above function can corrupt the OS stack
The software program can be terminated because of a SEGFAULT
If we change the ‘+’ to ‘-’ in line#4, the function executes correctly
If we change the ‘+’ to ‘-’ in line#4, the value of stack pointer while executing printf will be
less than ptr
Feedback

Your answer is incorrect.


The correct answers are: The above function can corrupt the user stack, The software
program can be terminated because of a SEGFAULT, If we change the ‘+’ to ‘-’ in line#4, the
function executes correctly, If we change the ‘+’ to ‘-’ in line#4, the value of stack pointer
while executing printf will be less than ptr

Quiz : 3

Started on Sunday, 12 February 2023, 8:02 PM


State Finished
Completed on Sunday, 12 February 2023, 8:29 PM
Time taken 27 mins 45 secs
Grade 10.00 out of 20.00 (50%)
Question 1
Correct
Mark 1.00 out of 1.00

Flag question

Question text

In a x86 system, the OS can execute the hlt instruction without causing any protection faults.

Select one:
True
False
Feedback

The correct answer is 'True'.

Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text

We can design an OS to allow a user mode program to handle a particular device interrupt
in user mode.

Select one:
True
False
Feedback

The correct answer is 'True'.

Question 3
Correct
Mark 1.00 out of 1.00

Flag question

Question text

When switching the context between two processes, the OS will explicitly change the stack
pointer at least once

Select one:
True
False
Feedback

The correct answer is 'True'.


Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text

In which of the following erroneous user space execution scenarios, the hardware will detect
the error and notify the OS?

Select one:
Invocation of a system call with an invalid system call number
Invocation of a system call with an invalid pointer
Setting the stack pointer register (SP) to an invalid address
None of the above
Feedback

Your answer is correct.


The correct answer is: None of the above

Question 5
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

If read access to the kernel stack of a single-threaded process P is allowed from user mode,
isolation will be compromised.

Select one:
True
False
Feedback

The correct answer is 'False'.


Question 6
Correct
Mark 3.00 out of 3.00

Flag question

Question text

In a Unix/Linux system, a process invoking the sleep() system call will

Select one or more:


stop/suspend its execution in kernel mode and go to waiting state.
stop/suspend its execution in user mode and go to the waiting state.
resume its execution in kernel mode after sleep timeout.
resume its execution in user mode after sleep timeout.
result in freeing of its kernel stack by the OS
Feedback

Your answer is correct.


The correct answers are: stop/suspend its execution in kernel mode and go to waiting state.,
resume its execution in kernel mode after sleep timeout.

Question 7
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text

In a computer system with 4 CPUs, a rouge application creates four processes and executes
infinite loop in each process. Which of the following statement(s) is/are true?

Select one or more:


Considering a Linux/Unix OS, the system will hang in the above scenario
Considering a Linux/Unix OS, the superuser will be able to kill the processes.
If the OS had disabled only the timer interrupts on all CPUs, the super user will never be able
to kill the processes
If the OS had disabled all interrupts (assuming non-maskable interrupts are also disabled) on
all CPUs, the super user will not be able to kill the processes.
If one of the processes access an illegal address, the OS can terminate all processes
Feedback

Your answer is incorrect.


The correct answers are: Considering a Linux/Unix OS, the superuser will be able to kill the
processes., If the OS had disabled all interrupts (assuming non-maskable interrupts are also
disabled) on all CPUs, the super user will not be able to kill the processes., If one of the
processes access an illegal address, the OS can terminate all processes

Question 8
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text

In which of the following scenario(s), the OS-mode execution may be triggered in a X86
system?

Select one or more:


A network packet arrives in the system
A user program invokes another function
A user program returns from a function
A user program executes an int instruction
A user program accesses a NULL pointer
Feedback

Your answer is incorrect.


The correct answers are: A network packet arrives in the system, A user program invokes
another function, A user program returns from a function, A user program executes an int
instruction, A user program accesses a NULL pointer

Question 9
Incorrect
Mark 0.00 out of 3.00
Flag question

Question text

Select one or more:


The value printed in L1 will be the same for all invocations of valloc.
The value printed in L2 will be the same for all invocations of valloc.
Given that valloc is invoked only from a particular system call handler, the value printed in L2
will be same for all invocation of valloc.
Given that valloc is invoked only from a particular system call handler, the value printed in L2
will be same for all invocation of valloc for any given process.
The value printed in L2 will be the same when valloc is invoked from different system call
handlers for any given process.
Feedback

Your answer is incorrect.


The correct answers are: The value printed in L2 will be the same for all invocations of
valloc., Given that valloc is invoked only from a particular system call handler, the value
printed in L2 will be same for all invocation of valloc., Given that valloc is invoked only from
a particular system call handler, the value printed in L2 will be same for all invocation of
valloc for any given process., The value printed in L2 will be the same when valloc is invoked
from different system call handlers for any given process.

Question 10
Correct
Mark 3.00 out of 3.00
Flag question

Question text

Consider a scenario where because of a OS bug, some part of the code segment of a user
process P is modified by the OS. Which of the following statements is/are true in this
scenario? (Assume there are no other bugs in the OS)

Select one or more:


P may be terminated by the OS because of an illegal memory access
P may be terminated by the OS because of an illegal instruction (invalid opcode)
P may successfully complete its execution
P can be abruptly terminated by the hardware without notifying the OS
If P is abruptly terminated, both the hardware and OS must be involved in terminating P
Feedback

Your answer is correct.


The correct answers are: P may be terminated by the OS because of an illegal memory
access, P may be terminated by the OS because of an illegal instruction (invalid opcode), P
may successfully complete its execution, If P is abruptly terminated, both the hardware and
OS must be involved in terminating P

Finish review

Quiz 4:

Started on Sunday, 26 February 2023, 8:00 PM


State Finished
Completed on Sunday, 26 February 2023, 8:29 PM
Time taken 29 mins 27 secs
Grade 5.00 out of 20.00 (25%)
Question 1
Incorrect
Mark 0.00 out of 1.00
Flag question

Question text

Two directories in a computer can have the same inode number.

Select one:
True
False
Feedback

The correct answer is 'True'.

Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text

Address translation mechanisms do not impose any limit on the physical address size of a
system.

Select one:
True
False
Feedback

The correct answer is 'False'.

Question 3
Correct
Mark 1.00 out of 1.00

Flag question
Question text

The OS can handle a page fault without allocating any physical frame.

Select one:
True
False
Feedback

The correct answer is 'True'.

Question 4
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

In the Unix file system with 4KB block size and inode size of 512 bytes, what is the minimum
number of block accesses (read and write) required to allocate an inode in a persistent
manner? Assume that only the super block is present in memory and disk I/O can be
performed at block size (4KB) granularity.

Select one:
3
4
2
1
Feedback

Your answer is incorrect.


The correct answer is: 4

Question 5
Incorrect
Mark 0.00 out of 1.00

Flag question
Question text

Consider a file system employing linked allocation where the address of the last block is
stored in the inode. Which of the following statement is true?
Select one:
Random write to the file will require scanning all data blocks
Random read to the file will require scanning all data blocks
Both A and B
None of the above
Feedback

Your answer is incorrect.


The correct answer is: None of the above

Question 6
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text

Consider a single-threaded process in the Linux/Unix system. The process performs write
access on a valid (previously allocated) user space address with proper permissions that
results in a page fault. Which of the following statement(s) is/are true in normal operating
conditions? Normal operating conditions refer to absence of extreme resource crunch
scenarios.

Select one or more:


The OS will not generate a segmentation fault in this case
The OS page fault handler may not modify the page table to handle the fault
The OS page fault handler may perform swap-in to handle the fault
The process may be descheduled because of this fault
The process may be terminated because of this fault
Feedback

Your answer is incorrect.


The correct answers are: The OS will not generate a segmentation fault in this case, The OS
page fault handler may perform swap-in to handle the fault, The process may be
descheduled because of this fault

Question 7
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text

Which of the following statements is/are true? Assume a system without any disk caches
where the super block and the inodes are present in memory.

Select one or more:


With only direct indexing, random access to a single file block will require only one disk
block access
With only indirect indexing, random access to a single file block may require more than one
disk block accesses.
With only indirect indexing, random access to a single file block will require more than one
disk block accesses.
In hybrid indexes (like Ext2), random access to any file block will require more than one disk
block accesses.
With only direct indexing, maximum file size supported by a file system is limited by the
inode size
Feedback

Your answer is incorrect.


The correct answers are: With only direct indexing, random access to a single file block will
require only one disk block access, With only indirect indexing, random access to a single
file block may require more than one disk block accesses., With only indirect indexing,
random access to a single file block will require more than one disk block accesses., With
only direct indexing, maximum file size supported by a file system is limited by the inode
size

Question 8
Correct
Mark 3.00 out of 3.00
Flag question

Question text

Consider a file system with block layer cache to store frequently accessed blocks in the
RAM. Further, consider the file system block size is of 4KB. Which of the following system
call(s) may require some disk accesses before the system call returns to the user space?

Select one or more:


open
read
write
lseek
dup
Feedback

Your answer is correct.


The correct answers are: open, read, write

Question 9
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text

The maximum physical address size supported (irrespective of the actual physical memory
size of the system) by a multi-level paging system depends on the

Select one or more:


number of access/flag bits in the page table entries
number of levels in the page table
number of processes in the system
size of the process address space
page size
Feedback
Your answer is incorrect.
The correct answers are: number of access/flag bits in the page table entries, number of
levels in the page table, size of the process address space, page size

Question 10
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text

Consider a paging system with 48-bit virtual address, 4-level page tables (L1 is the root-
level pointed to by the CR3 register) and page size of 4KB. At each level, 9-bits of virtual
address are used to index into the page table entry location (same as 48-bit system
explained in the lectures). Which of the following statement(s) is/are true assuming that the
OS uses a separate address space?

Select one or more:


If there are 16 processes in the system, the virtual address size of each process will be 256TB
(1T B = 240 bytes).
If there are 32 processes in the system, the virtual address size of each process will be 8TB
(1T B = 240 bytes).
Maximum amount of physical memory used to maintain the L2 page tables of any process is
2MB (1MB = 220 bytes).
An entry in the L2 page table can be used to translate a continuous virtual address range of
maximum size 2MB (1MB = 220bytes).
An entry in L2 page table can be used to translate a continuous virtual address range of
maximum size 1GB (1GB = 230bytes).
Feedback

Your answer is incorrect.


The correct answers are: If there are 16 processes in the system, the virtual address size of
each process will be 256TB (1T B = 240 bytes)., Maximum amount of physical memory used
to maintain the L2 page tables of any process is 2MB (1MB = 220 bytes)., An entry in L2 page
table can be used to translate a continuous virtual address range of maximum size 1GB (1GB
= 230bytes).
Finish review
Quiz : 5

Started on Sunday, 12 March 2023, 8:00 PM


State Finished
Completed on Sunday, 12 March 2023, 8:28 PM
Time taken 28 mins 15 secs
Grade 9.00 out of 20.00 (45%)
Question 1
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

A new file can not be created in an existing file system residing on a logical disk partition
without mounting the file system.

Select one:
True
False
Feedback

The correct answer is 'False'.

Question 2
Correct
Mark 1.00 out of 1.00

Flag question

Question text

An OS for a single CPU system can be designed without using any locks.

Select one:
True
False
Feedback

The correct answer is 'True'.

Question 3
Correct
Mark 1.00 out of 1.00

Flag question

Question text

The page fault handler in the Unix/Linux OS does not require any locking.

Select one:
True
False
Feedback

The correct answer is 'False'.

Question 4
Correct
Mark 1.00 out of 1.00

Flag question

Question text

When the OS performs a context switch between two threads of a multi-threaded process in
a X86 system,

Select one:
The values of all registers of the outgoing thread are not required to be saved
The values of all registers of the outgoing thread are required to be saved
Only the stack pointer register value of the outgoing thread is required to be saved
Only the stack pointer and base pointer register value of the outgoing thread are required to
be saved
Feedback

Your answer is correct.


The correct answer is: The values of all registers of the outgoing thread are required to be
saved

Question 5
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

Consider a file system with inode size 256 bytes and block size of 4KB (4096 bytes). Further,
consider that 200 bytes of the inode is consumed to maintain all information about the
file/directory except the block index maps. If the
le system is designed to support an underlying storage device of maximum size one
terabyte (1TB) and employs only direct indexing, what is the maximum File size supported
by the file system?

Select one:
28KB
32KB
56KB
64KB
Feedback

Your answer is incorrect.


The correct answer is: 64KB

Question 6
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text

Select the correct answer(s) for the following questions. Note that, you have to write all
correct choices to get the credits (no partial marks). No explanation required.
After a system crash, if the inode bitmap corresponding to a particular inode is set in the
Unix
le system, which of the following statement(s) is/are false?

Select one or more:


If the corresponding (on-disk) inode is intact and contains proper values, then there can be
no file system inconsistencies involving the inode
If the inode creation time is before the last mount time of the
le system, then there can be no file system inconsistencies involving the inode
If the inode last modi
cation time is before the last mount time of the
le system, then there can be no file system inconsistencies involving the inode
If the inode represents an empty file (size = 0), then there can be no
le system inconsistencies involving the inode
If the inode represents an empty directory (no children), there can be no
le system inconsisten- cies involving the inode
Feedback

Your answer is incorrect.


The correct answers are: If the corresponding (on-disk) inode is intact and contains proper
values, then there can be no file system inconsistencies involving the inode, If the inode
creation time is before the last mount time of the
le system, then there can be no file system inconsistencies involving the inode, If the inode
last modi
cation time is before the last mount time of the
le system, then there can be no file system inconsistencies involving the inode, If the inode
represents an empty file (size = 0), then there can be no
le system inconsistencies involving the inode, If the inode represents an empty directory (no
children), there can be no
le system inconsisten- cies involving the inode

Question 7
Correct
Mark 3.00 out of 3.00

Flag question

Question text

Consider a file system with page cache (to store file blocks in RAM). Which of the following
statement(s) is/are true?

Select one or more:


Accessing any o
set of a
le may require accessing the
le indexes
Accessing any o
set of a
le may not require accessing the
le indexes
Accessing any o
set of a
le require accessing the
le indexes only if the block corresponding to the file offset is not in the page cache
Accessing any offset of a file may require accessing the disk only if the block corresponding
to the file offset is not in the page cache
If two processes open a given
le and access its
rst block repeatedly, the data block corresponding to the
rst
le block is guaranteed to be present in the page cache.
Feedback

Your answer is correct.


The correct answers are: Accessing any o
set of a
le may require accessing the
le indexes, Accessing any o
set of a
le may not require accessing the
le indexes, Accessing any o
set of a
le require accessing the
le indexes only if the block corresponding to the file offset is not in the page cache,
Accessing any offset of a file may require accessing the disk only if the block corresponding
to the file offset is not in the page cache

Question 8
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text

Consider two threads T1 and T2 of a process P created using the pthread APIs in a
Unix/Linux system. Which of the following statement(s) is/are true.

Select one or more:


T1 can access a pointer declared in the global scope after it is initialized by T2
T1 can access an address after it is allocated using mmap by T2
T1 can access a variable after it is allocated in the stack area of P
T1 can access a
le after it is closed from T2
T1 can read from a pipe using the read-end of the pipe (declared in the global scope) after
T2 successfully creates and writes some content to the write-end of the pipe.
Feedback

Your answer is incorrect.


The correct answers are: T1 can access a pointer declared in the global scope after it is
initialized by T2, T1 can access an address after it is allocated using mmap by T2, T1 can access
a variable after it is allocated in the stack area of P, T1 can read from a pipe using the read-
end of the pipe (declared in the global scope) after T2 successfully creates and writes some
content to the write-end of the pipe.

Question 9
Incorrect
Mark 0.00 out of 3.00

Flag question

Question text

Consider the following pseudocode.

Which of the following can be the correct output(s) if one thread executes string() and the
other thread executes number() concurrently?

Select one or more:


AB12
A1B2
12AB
1AB2
1A2B
Feedback

Your answer is incorrect.


The correct answers are: A1B2, 12AB, 1AB2, 1A2B

Question 10
Correct
Mark 3.00 out of 3.00

Flag question

Question text

Consider two threads T1 and T2 of a process P created using the pthread APIs in a Unix/Linux
system. Which of the following statement(s) is/are false.

Select one or more:


If T1 is in kernel mode, T2 is not allowed to enter the kernel mode
The kernel stack used by T1 and T2 are di
erent
The page fault handler in the OS must handle the page faults caused by T1 and T2 in a
serial manner
When the OS scheduler performs a context switch between T1 and T2, the page table base
pointer (CR3) register is not changed
When the OS scheduler performs a context switch between T1 and P, the page table base
pointer (CR3) register is changed
Feedback

Your answer is correct.


The correct answers are: If T1 is in kernel mode, T2 is not allowed to enter the kernel mode,
The page fault handler in the OS must handle the page faults caused by T1 and T2 in a
serial manner, When the OS scheduler performs a context switch between T1 and P, the
page table base pointer (CR3) register is changed

Finish review

You might also like