Αρχική ΑΕΠΠ - Δομές Δεδομένων Λειτουργικά Συστήματα Δίκτυα Υπολογιστών ΙΙ Βάσεις Δεδομένων Παιδαγωγικά - Διδακτική

Εισαγωγικά

Εισαγωγή στα Λ.Σ. Βασικές Δομές Η/Υ Βασικές Δομές Λ.Σ

Διεργασίες

Διεργασίες Χρονοπρογραμματισμός Συγχρονισμός

Αδιέξοδα

Μνήμη

Μονοπρογραμματισμός Εναλλαγή Εικονική Μνήμη Κατάτμηση

Είσοδος / Έξοδος

Σύστημα Αρχείων

Διεπαφή Υλοποίηση

 Ιστορικό Πρόσφατες αλλαγές Εκτύπωση Αναζήτηση

Ιστορικό: OS.Processes

Εμφάνιση μικρών αλλαγών - Αλλαγές κώδικα

24-07-2008 (11:02) από Άρης -
Αλλαγή σειρών 304-437 από:

σε:

Question

Several popular microcomputer operating systems provide little or no means of concurrent processing. Discuss the major complications that concurrent processing adds to an operating system.

Answer

  • A method of time sharing must be implemented to allow each of several processes to have access to the system. This method involves the preemption of processes that do not voluntarily give up the CPU (by using a system call, for instance) and the kernel being reentrant (so more than one process may be executing kernel code concurrently).
  • Processes and system resources must have protections and must be protected from each other. Any given process must be limited in the amount of memory it can use and the operations it can perform on devices like disks.
  • Care must be taken in the kernel to prevent deadlocks between processes, so processes aren’t waiting for each other’s allocated resources.

Question

Describe the differences among short-term, medium-term, and long-term scheduling.

Answer

  • Short-term (CPU scheduler) -selects from jobs in memory, those jobs which are ready to execute, and allocates the CPU to them.
  • Medium-term -used especially with time-sharing systems as an intermediate scheduling level. A swapping scheme is implemented to remove partially run programs from memory and reinstate them later to continue where they left off.
  • Long-term (job scheduler) -determines which jobs are brought into memory for processing.

The primary difference is in the frequency of their execution. The short-term must select a new process quite often. Long-term is used much less often since it handles placing jobs in the system, and may wait a while for a job to finish before it admits another one.


Question

A DECSYSTEM-20 computer has multiple register sets. Describe the actions of a context switch if the new context is already loaded into one of the register sets. What else must happen if the new context is in memory rather than a register set, and all the register sets are in use?

Answer

The CPU current-register-set pointer is changed to point to the set containing the new context, which takes very little time. If the context is in memory, one of the contexts in a register set must be chosen and moved to memory, and the new context must be loaded from memory into the set. This process takes a little more time than on systems with one set of registers, depending on how a replacement victim is selected.


Question

What two advantages do threads have over multiple processes? What major disadvantage do they have? Suggest one application that would benefit from the use of threads, and one that would not.

Answer

Threads are very inexpensive to create and destroy, and they use very little resources while they exist. They do use CPU time for instance, but they don’t have totally separate memory spaces. Unfortunately, threads must “trust” each other to not damage shared data. For instance, one thread could destroy data that all the other threads rely on, while the same could not happen between processes unless they used a system feature to allow them to share data. Any program that may do more than one task at once could benefit from multitasking. For instance, a program that reads input, processes it, and outputs it could have three threads, one for each task. “Single-minded” processes would not bene?t from multiple threads; for instance, a program that displays the time of day.


Question

What resources are used when a thread is created? How do they differ from those used when a process is created?

Answer

A context must be created, including a register set storage location for storage during context switching, and a local stack to record the procedure call arguments, return values, and return addresses, and thread-local storage. A process creation results in memory being allocated for program instructions and data, as well as thread-like storage. Code may also be loaded into the allocated memory


Question

Describe the actions taken by a kernel to switch context

  1. Among threads.
  2. Among processes.

Answer

  1. The thread context must be saved (registers and accounting if appropriate), and another thread’s context must be loaded.
  2. The same as (a), plus the memory context must be stored and that of the next process must be loaded.

Question

What are the differences between user-level threads and kernel-supported threads? Under what circumstances is one type “better” than the other?

Answer

User-level threads have no kernel support, so they are very inexpensive to create, destroy, and switch among. However, if one blocks, the whole process blocks. Kernel-supported threads are more expensive because system calls are needed to create and destroy them and the kernel must schedule them. They are more powerful because they are independently scheduled and block individually.


Question

Consider the interprocess-communication scheme where mailboxes are used. Suppose a process P wants to wait for two messages, one from mailbox A and one from mailbox B. What sequence of send and receive should it execute?

Answer


Question

Consider an operating system that supports both the IPC and RPC schemes. Give examples of problems that could be solved with each type of scheme. Explain why each problem is best solved by the method that you specify.

Answer

24-07-2008 (10:28) από Άρης -
Πρόσθεση σειράς 1:
24-07-2008 (10:27) από Άρης -
Αλλαγή σειρών 3-303 από:

In this section we introduce the concept of a process and the notion of concurrent execution. Those are at the very heart of modern operating systems. A process is is a program in execution and is the unit of work in a modern time-sharing system. Such a system consists of a collection of processes: Operating-system processes executing system code, and user processes executing user code. All these processes can potentially execute concurrently, with the CPU (or CPUs) multiplexed among them. By switching the CPU between processes, the operating system can make the computer more productive. We also discuss the notion of a thread (light-weight process) and interprocess communication (IPC).

σε:

In this section we introduce the concept of a process and the notion of concurrent execution. Those are at the very heart of modern operating systems. A process is is a program in execution and is the unit of work in a modern time-sharing system. Such a system consists of a collection of processes: Operating-system processes executing system code, and user processes executing user code. All these processes can potentially execute concurrently, with the CPU (or CPUs) multiplexed among them. By switching the CPU between processes, the operating system can make the computer more productive. We also discuss the notion of a thread (light-weight process) and interprocess communication (IPC).


Question

What is a process?

Answer

A program in execution.


Question

What is a PCB?

Answer

Process control block. It contains various data structures.


Question

List some of the queues on a typical system.

Answer

Ready, run, I/O.


Question

How are these queues typically implemented?

Answer

FIFO queues, trees, linked-lists.


Question

How many device queues are there on a system?

Answer

One for each device.


Question

What does the long-term scheduler do?

Answer

Determines which jobs belong in the current mix of running/waiting jobs.


Question

Determines which jobs belong in the current mix of running/waiting jobs.

Answer

Determines which of the current jobs should run in the next CPU burst.


Question

Which scheduler must work very fast in order not to waste significant CPU time? Which can be slow?

Answer

Fast: short-term. Slow: long-term.


Question

What is the “degree of multiprogramming?”

Answer

Number of jobs in the current mix of running/waiting jobs.


Question

When is the long-term scheduler invoked?

Answer

When a job is completed, or when the degree of multiprogramming hasn’t yet been reached.


Question

True/False: The long-term scheduler selects a group of I/O-bound jobs or a group of CPU-bound programs for subsequent activity. Explain.

Answer

False. It selects a mix of jobs for efficient machine utilization.


Question

What is time sharing? What kind of scheduling does it involve?

Answer

Time sharing is many users interactively using a system “simultaneously;” each user gets a share of CPU-time, after other users have gotten their share. It uses medium-term scheduling, such as round-robin for the foreground. Background can use a different scheduling technique.


Question

Explain the meaning of: “time sharing depends on negative feedback of the users for speedy operation.”

Answer

Users who are impatient with the long response time will log off, resulting in fewer users on the system, with faster response time.


Question

What is swapping?

Answer

Copying a process out of memory onto a fast disk or drum, to allow space for other active processes; it will be copied back into memory when space is ample.


Question

What is a context switch?

Answer

The time needed to switch from one job to another.


Question

Describe five implementations of the create-new-process mechanism.

Answer

  1. Parent continues executing.
  2. Parent stops executing until children are done.
  3. Parent and children share all variables.
  4. Children share only a subset of parent’s variables.
  5. Parents and children share no common resources.

Question

Describe the producer/consumer problem.

Answer

The consumer can’t be allowed to use a result until the producer has created that result, and the producer can’t be allowed to create results if the buffers are all full.


Question

Give examples of producer/consumer pairs.

Answer

compiler/linker, linker/loader, card-reader/line-printer


Question

How do you implement a circular array?

Answer

Using mod arithmetic, like in clocks. Note: Several students have said by using linked lists; not so, authors replace the circular array with a linked list.


Question

How do you determine if the buffers (or arrays) are all full in circular arrays?

Answer

If the input-pointer is one less than the output-pointer in mod arithmetic.


Question

How do you determine if the buffers (or arrays) are all empty?

Answer

If the input-pointer equals output-pointer.


22-07-2008 (18:52) από Άρης -
Πρόσθεση σειρών 1-3:

Διεργασίες

In this section we introduce the concept of a process and the notion of concurrent execution. Those are at the very heart of modern operating systems. A process is is a program in execution and is the unit of work in a modern time-sharing system. Such a system consists of a collection of processes: Operating-system processes executing system code, and user processes executing user code. All these processes can potentially execute concurrently, with the CPU (or CPUs) multiplexed among them. By switching the CPU between processes, the operating system can make the computer more productive. We also discuss the notion of a thread (light-weight process) and interprocess communication (IPC).

Τελευταία ενημέρωση: 24-07-2008 (11:02)

Copyright 2008 - Άρης Φεργάδης