1) Explain the use of trap in operating systems. 2) Suppose you have a multiproc
ID: 3671082 • Letter: 1
Question
1) Explain the use of trap in operating systems.
2) Suppose you have a multiprocessor system with 4 equal capability processors. A special-purpose OS is installed in the system. The OS supports multi-threading by providing up to 4 kernel threads per application program and uses many-to-many model to map user threads to kernel threads. The system is currently running only one process. The program is multithreaded and works on square arrays of size at least 3 × 3. The program performs component-wise multiplication of each row of one square array with each row of another square array of same dimension. Each such row-row multiplication is handled in a separate user thread. Do you think 100% processor utilization (theoretically) can always be achieved if it is assumed that not all kernel threads can block at the same time? Justify your answer. You can ignore processor requirement for any other processes (system processes) in the system.
3) Assume that you are trying to download a large file (terabyte order) from the Internet. The file is available from a set of mirror servers, each of which can deliver a subset of the file’s bytes; assume that a given request specifies the starting and ending bytes of the file. Explain how you might use threads to improve the download time.
4)Explain why, in Unix systems, a fork() is typically followed by a execv() or similar system call by the child process.
Explanation / Answer
(.1)
thukral.rahul
A Trap is a Software generated interrupt. A Trap is set to have occured when some exceptions occurs like - a process accessing a memory address outside it's address space would result in a trap which is handled by the OS.
Generally a System architecture has a limited number of interrupts that can occur within that particular system, So a table of pointers called a interrupt vector table is genearally maintained in the low memory area which can we used to call the appropriate interrupt service routine.
Interrupts can be either hardware or software genearated.
(2)
threads, per se, isn't really a threading library. pthreads is the interface which a specific threading library implements, using the concurrency resources available on that platform. So there's a pthreads implementation on linux, on bsd, on solaris, etc., and while the interface (the header files and the meaning of the calls) is the same, the implementation of each is different.
So what pthread_create actually does, in terms of kernel thread objects, varies between OSes and pthread library implementations. At a first approximation, you don't need to know (that's stuff that the pthread abstraction allows you to not need to know about). Eventually you might need to see "behind the curtain", but for most pthread users that's not necessary.
(3) You can do many things with your big data if you can bring it to the cloud. You can run business intelligence or data analytics with it and obtain valuable insights. You can make it available to consumers and customers anytime/anywhere and facilitate better collaboration and product distribution. Or you can simply store it for safekeeping. and you can download teracopy latest version/ IDM and improve the download time
But before you can leverage the power of the cloud, there's one big obstacle you need to hurdle - getting all that big data there.
(.4)Each function is used to create a child process. However, fork() has no parameters; CreateProcess() has ten. Furthermore, whereas the child process created with fork() inherits a copy of the address space of its parent, the CreateProcess() function requires specifying the address space of the child process.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.