OS Question
i think the above explanation is wrong please verify it once again or clear me if i am wrong creation of thread depends on ur system config and ur process functionality ,like if ur system is single processor then when u create threads that will use same processor .but if ur system is multi processor then thread can be run on diff processor so benifit and if ur process is doing some work like i/o operation then u can create one thread for it because instead of waiting for another thread can do some thing else like its depend on ur process .no limit for thread creating on a process but u need to evaluate it how thread is required and how many will not make system burden .correct me if i am wrong
Typical interview question from OS are -
- Spock September 20, 20121. What are deadlocks? Deadlock prevention, deadlock avoidance and deadlock detection.
2. What are semaphores and mutex? Difference between semaphores and mutex? Difference between semaphores and monitors?
3. What are processes? What are threads? Difference between process and thread? How threads work?
4. What is virtual memory? How is virtual memory different from RAM? What are pages? What is page fault? Different algos for page fault?
5. What is internal and external fragmentation? What is segmentation?
6. What is a kernel? What are system calls? Difference between kernel threads and user threads?
7. Use of fork() system call to create child processes.
Well a process can either be single threaded or multi threaded. By increasing the number of threads though you are increasing the parallality of the system but you are also increasing the load on the system. More number of threads means more resource utilization for the same amount of work. So until you are working on a distributed system or on a system in which you want to do a lot of parallel processing than only you shold go for multi threading. Else single thread for a process is sufficient and best.
I hope I am clear. Thank you