Describe main memory ** Answer** Main memory consists of a collection of locations,
each of which is capable of storing both instructions and data. Every location has an address and
the locations contents. The address is used to access the location, and the contents of the location
is the instruction or data stored in the location.
Describe five main parts of a CPU ** Answer** Control Unit, Data Path,
Interconnect(Busses), Program Counter, Registers.
Define what a process is and describe five components ** Answer** An instance of a
computer program that is being executed.
- The executable machine language program.
- A block of memory, which will include the executable code, a call stack that keeps track of
active functions, a heap that can be used for memory explicitly allocated by the user program,
and some other memory locations.
- Descriptors of resources that the operating system has allocated to the process, for example, file
descriptors.
- Security information--for example information specifying which hardware and software
resources the process can access.
, - Information about the state of the process, such as whether the process is ready to run or is
waiting on some resource, the content of the registers, and information about the process's
memory.
What is threading, and how does it work? ** Answer** Threading provides a mechanism for
programmers to divide their program into more or less independent tasks, with the property that
when one thread is blocked, another thread can be run. Threads are contained within processes,
so they use the same executable, and they usually share the same memory and I/O devices. They
have their own program counters and call stacks. If a process is the "master" thread of execution
and threads are started and stopped by the process, then we can envision the process and its
threads as lines: when a thread is started, it forks off the process; when a thread terminates, it
joins the process.
Define cache; what is its function? ** Answer** A cache is a collection of memory locations
that can be accessed in less time than some other memory locations.
Its function is to reduce the time needed to access data.
Define two principles of locality. ** Answer** Spatial Locality - A program will access a
nearby location.
Temporal Locality - In the near future.
What are levels of cache from faster to slower? ** Answer** L1, L2, L3.