Sunteți pe pagina 1din 3

Process Management

1. What is a process? a. Process is thread of execution of a program along with its data. i. Process is also called task. 2. What are threads? a. Threads are object of activity within process. 3. What is the difference between a process and thread in linux? a. Linux implements threads in a unique way and does not differentiate threads and processes. 4. How a new process is created? What is parent and child? a. Process is created using fork(), vfork(). In linux clone() is used. i. Process that is forking is called parent ii. New process that created when forked is called child iii. All processes having coming parent are called siblings 5. What is task list? a. Kernel stores the processes in a circular doubly linked list called task list. i. Each element in the task list is process descriptor of the type struct task_struct 6. Process descriptor and task structure? a. Process descriptor contains the data that describes the executing program open files, processs address space, pending signals, etc 7. What is hardware context? a. Context of the currently running process, in processor, is contained in machine registers. This information collectively is called hardware context. i. Program counter (PC) It holds address of the next instruction to execute ii. Stack Pointer (SP) It is the address of the uppermost element of the stack iii. Processor Status Word (PSW) It contains status bits of containing information about system state iv. Memory Management Registers (MMR) It maps address translation tables of the process v. Floating Point Unit (FPU) registers 8. What is stack pointer? a. Stack pointer is the address of the uppermost element of the stack 9. Each tasks thread_info structure is stored at the end of its stack 10. What is process state model? a. Process in linux has 5 possible states 11. What is TASK_RUNNING? a. Process is runnable; It is either currently running or on a runqueue waiting to run 12. What is TASK_INTERRUPTIBLE? a. Process sleeping (means it is blocked) waiting for some condition to occur i. When condition occurs, kernel sets the processs state to TASK_RUNNING

13.

14.

15. 16.

17. 18.

19.

20. 21. 22.

23. 24. 25. 26.

27.

ii. Process also awakes prematurely and becomes runnable when it receives a signal What is TASK_UNINTERRUPTIBLE? a. It is same as TASK_INTERRUPTIBLE except that it does not wakeup and become runnable when it receives a signal What is TASK_ZONBIE ? a. Task has terminated but its parent has not yet issued wait4() system call. i. wait4() system call deallocates process descriptor What is TASK_STOPPED ? a. Process execution has stopped What is the difference between TASK_INTERRUPTIBLE and TASK_UNINTERRUPTIBLE? a. Both processes sleep for a waiting condition to occur. TASK_INTERRUPTIBLE task wakes up and becomes runnable when it receives a signal while TASK_UNINTERRUPTIBLE do not become runnable on receving a signal How to manipulate current process state? a. Current tasks state can be manipulated using set_task_state (task, state) What is process context? a. Normal program execution occurs in user space. When a program executes a system call or triggers an exception, it enters kernel space. At this point kernel is said to be executing on behalf of the process and is in process context. What is copy-on-write (COW)? a. COW is technique to delay or altogether prevent copying of the process data. Instead of copying process address space, parent and child can share a single copy. Data is marked in such a way that if it is written to a duplicate is createdand each process receives a unique copy. i. Duplication of resources occur only when they are written until then they are shared read only. Explain fork ()? Explain vfork ()? What is the difference between fork () and vfork ()? a. vfork() system call has same effect as fork() except that page table entries of the parent are not copied for child instead child executes as the sole process in the parents address space. What is a lightweight process? a. Lightweight process is a thread. What are kernel threads? a. Kernel threads are standard processes that exist solely in kernel space. Process termination? a. Process is terminated using exit() Removal of the process descriptor? a. A process when terminated using exit(), its process descriptor is not removed. It is deallocated after its parent has obtained information that its child is terminated. What is a zombie? a. A process when terminated using exit(), its process descriptor is not removed but still it cannot run. This state is called zombie.

28. What is ptraced child list? a. If a parent is terminated before its children, children are reparented and listed in ptraced child list.

S-ar putea să vă placă și