• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/33

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

33 Cards in this Set

  • Front
  • Back

What is a process state?

When a process executes, it changes state

List the process states

New - process being created


Running - instructions are being executed


Waiting - waiting for an even to occur


ready- the process is waiting to be assigned to a processor


Terminated - The process has finished execution

How many processes can be running at a time?

One can be running on any processor at any instant. However many processes may be ready and waiting.

What is the other name for Process Control Block (PCB)?

Task control Block

What are the process control block?

It is a process associated with process states, program counter, cpu registers, cpu-scheduling information, memory management, accounting information, and I/O status.

What is a program counter?

The counter indicates the address of the next instruction to be executed for this process.

What is a CPU register?

The registers very in number and type, depending on the architecture.

What does the CPU register include?

Accumlators


Index registers


stack pointers


general purpose registers


an condition code info

List the CPU-scheduling information

Process priority


pointers to scheduling queues


Any other parameters

What is memory management information?

May include such items as the value of the base and limit registers and the pages tables or the segment tables.

List the accounting information

Includes


amount of CPU


Real time used


time limits


account numbers


job or process numbers

List the I/O status info

Includes


I/O devices


Allocated to the process


a list of open files

What is interprocess communication?

Processes within a system may be independent or cooperating.




Cooperating process can affect or be affected by other processes, including shared data

What are the reasons of cooperating process?

Information sharing


Computation speedup


Modularity


Convenience

What does the cooperating process need?

Interprocess communication (IPC)

What are the two models of IPC?

Shared memory


message-passing

What is shared memory?

Requires communicating processes to establish a region which resides in the address space of the process creating shared-memory segment.




read and write in the same shared areas.

What are the two types of buffers?

Unbounded Buffer - places no practical limit on the size of the buffer.




Bounded Buffer- fixed buffer size.

What is message-passing?

Provides a mechanism to allow processes to communicate and to synchronize their actions without sharing the same address place.



Communication link must exist.

What are the different communication links?

Direct or indirect communication


Synchronous or asynchronous communication


Automatic or explicit buffering.

What is the difference between threads and processes?

Process creation are heavy-weight.


Threads are light-weight.


Threads are responsive, resource sharing, economical and scalability.

What are the user thread to kernal thread mapping?

many-to-one model


One-to-one model


Many-to-many model


Two-level model

What is many-to-one model?

Single kernal thread


Efficient but process may block if thread makes a blocking system call

What is one-to-one model?

Each thread maps to kernal


Allows multiple thread to kernal

What is many-to-many model?

Allow many threads to be mapped to many kernals.

What is two-level model?

Bound to kernal thread

What is PThread library?

It's the posix library for creating threads.

Shared memory and message passing are two models of interprocess communication. Briefly describe each.

The shared memory modes consists of processes sharing a region of their respective memory spaces, so that when one process writes to this region, the other processes sharing it can see the newly written data. The message passing model consists of processes sending messages to other processes using the kernal as an intermediary.

Why is exec() generally called after fork() when there is no equilvalent functions called after CreateProcess()?

CreateProcess() takes as an argument that name of an executable file to execute, whereas fork() simply creates a copy of the current process. IN order to create a child process that will execute a different executable file than the parent's, a processes must call exec() after fork().

Give two advantages of creating multiple threads instead of multiple processes in a parallel program.

Creating threads involves less overhead for the kernel than creating processes. Threds share a global memory space, facililtating communication between them.

Which of the following components of program state are shared across threads in a multithreaded process?


a. Register values


b. heap memory


c. Global variables


d. Stack memory

b and c are shared across threads.

What are the two models of interprocess communication? What are the strengths and weaknesses of the two approaches?

The two models are shared memory and message-passing. Shared memory allows direct exchanges of information, but requires processes to manage access to that information to prevent conflicts from occurring. Message-passing prevents conflicts, but also incurs additiona overhead.

Look at question 3, wednesday night quiz 2.

child: pid = 0, pid1 = <child pid>


parent: pid = <child pid>, pid1 = <parent pid>