In: Computer Science
.What is the role of interrupt vector table during interrupt processing?
b. How does OS make sure that a user process cannot access I/O devices or any other process’ memory areas?
c. How is data parallelism different from task parallelism? Which one of these approaches would you use if you had to compute the average of an array of million numbers? Why?
d. What kind of events can cause a process to leave CPU?
e. What is the main different between heap and stack segments of a process?
a.
Interrupt vector table is the table containing set of interrupts and it occupies space in the addressable memory.
Every entry in the interrupt vector table will be reserved for a specific purpose.
whenever an interrupt occurs while executing a process.The interrupt service routine will refer to the interrupt vector table by matching the interrupt with it's related entry and solves the interrupt.
b.
Operating system is wholly responsible for granting permissions for processes.
OS only allows kernel programs to access other data.
If any user program tries to access other data then the OS will crashes or interlocks the user program.
c.
Task parallelism is the execution of multiple tasks on multiple cores at a time.
Data parallelism is the execution of segments of same task on multiple cores at a time.
When we deal with one million array,we have to use data parallelism since it is huge task but it is single task.
d.
A process can leave CPU in these situations:
1.When ansoftware interrupt(System call) occurs.
2.When the process completes execution.
3.When there is need of input output.(it is also a type of hardware interrupt).
4.When a higher priority process arrives.
e.
Heap:
it is for dynamic memory allocation.
Heap stores the data related to pointers i.e., Dynamic memory allocation i.e., Variables that are created at runtime.
Stack:
it is for static memory allocation.
Stack stores the data related to function calls,function executions,etc.,(Related to recursive functions).i.e.,Variables at compile time.