In which Nelson and I talk about the beginning experiences of playing Final Fantasy XIII. I’m a little disapointed so far, but Nelson (the die hard FF fanboi) tells me to keep my chin up until we get a little farther along.
Personal Blog of Zacharias Stankiewicz
In which Nelson and I talk about the beginning experiences of playing Final Fantasy XIII. I’m a little disapointed so far, but Nelson (the die hard FF fanboi) tells me to keep my chin up until we get a little farther along.
1. The test-and-set (TS) instruction and the swap instruction are part of the hardware support for process synchronization contained in modern CPUs.
True. Since test-and-set solutions rely on condition codes (stored in the PSW), the processor reads the previous instruction.
2. Although the spin-lock solution and the Peterson algorithm provide busy-waiting solutions to the critical section problem, only the spin-lock solution controls the order of entry for waiting processes.
False. Spin-locks don’t control order. Peterson’s is a busy-wait in software.
3. In class we discussed a bounded-waiting solution to the critical section problem using test-and-set. This solution works because a process exiting the critical section transferees control of entry to the next process in an ordered list awaiting entry.
True. Bounded-waiting Mutual Exclusion with TestandSet().
4. In the single producer – single consumer, multi-slot budder problem, the critical section is the manipulation of the count of the number of filled cells.
True.
5. The implementation of the operations P & V on binary semaphores only require block/wakeup, while these same operations on general semaphores require block/wakeup and counting.
False. We want this to happen at their own rate. We are looking at the count value.
6. When semaphores and semaphore operations are implemented in a non-preeemmptable kernel, we will not have any busy waiting.
True. We need to do this if the semaphore is implemented in user-space.
7. In the multiple producer, multiple consumer problem with a multi-slot buffer, we require mutual exclusion of the ‘deposit’ and ‘take’ to ensure proper order of entry.
False. This solution doesn’t provide proper order. This only provides only the ability to feed the consumer empty spaces and the consumer full spaces.
8. How many philosophers may eat simultaneously in the Dining Philosophers problem with only 4 philosophers?
Two. Draw a picture if this isn’t obvious.
9. The readers-writers problem discussed in class…
c… required that no reader will be kept waiting unless a writer has already obtained permission to use the shared database.
10. A monitor wait() operation always blocks.
True. Waiting signal can be implemented using semaphores. A monitor wait using a binary semaphore initialized to 0, whenever a process waits, it’s guaranteed to block.
Questions about how semaphores are implemented and conditions are implemented. This is very important to synchronization.
1. Circle the following components of program state that are shared across threads in a multi-threaded process:
a. Register Values
b. Heap memory
c. Global values
d. Stack memory
e. Open Files
a, c, e.
Registers are part of the virtual CPU, as are stack and thread-private memory.
2. A good solution to the cirtical section problem included the condition of pregress, where each process waiting for entry to the critical section will be granted entry in order of arrival.
False.
Bounded waiting can be granted only after a certain amount of tried.
3. With user-level threads, thread control blocks are stored in memoery outside the kernel and managed in user mode.
True.
Everything that happens with management is done at user-level. The kernel doesn’t know about them. Only the process can manipulate them.
4. In an operating system that can schedule kernal level threads, there may be two independent thread scheduling mechanisms.
True.
There could be a user-level thread management system as well as the kernel’s.
5. A course-gained atomic action is one in which the statements in the critical section for a data item are designed so that the critical section cannot be executed concurrently with itself or other cirical sections for that data item.
True.
They are functionally indivisible. This is the def. of the critical path setion.
6. A thread pool is a collection of kernel threads, which can be created at process startup, reducing the real-time overhead of creating new application threads.
False.
When a user process creates a new thread, we’d like to map it to an existing kernel thread. The idea of pools is to have the threads already created, and it will map to a kernal thread. There is a delay involved with creating additional threads at the kernel level for user-level threads to map to.
7. Race conditions are possible in concurrent programs because of the unpredictable interleaving of atomic actions in the programs.
True.
Solve this and get a turing prize. Inturrupts aren’t serviced during atomic actions, for example.
8. In multithreaded programs, the kernel can inform an application about certain events using a proceadure known as an ______
upcall.
This sends a signal to the thread library to tell it to, for example, run another thread while that thread is locked. It is like a reverse
Not a signal, as they can/are be used for inter-process communication instead of an upcall, which is specific to threading. Also, the kernal can throw signals but not upcalls. The user-level thread library can receive signals, though.
9. Signals are delivered to a process, notifying it of the occurrence of an event, and synchronous signals are delivered to the thread running when the signal occurs.
True.
Async signals can be handled by any running thread.
Sync signals are in response to a failure (hardware-based): These are delivered to a running thread.
10. A successful call to an exec() function has a return to the calling program of a value 0, indicating no error.
False.
There is nobody to return to if you exec, exec overlays the running process (including, pid and other things, like file pointers)
1. The ready queue is essentially a linked list of the Process Control Blocks of all processes that have all required resources, except the CPU.
True
Don’t confuse this with the I/O queue.
2. I/O bound programs have a higher frequency of occurrence of large duration CPU bursts.
False
Why are they called I/O bound? Because they don’t need a lot of CPU (otherwise they’d be called CPU-bound)
3. The medium-term scheduler helps reduce the degree of multi-programming by removing partially executed processes from memory.
True
Three types- long term, medium, and short-term. The short term does most of the work, including choosing the next process to execute (by making the virtual CPU a real-life one).
The long term scheduler is in charge what processes can get some memory, thus being able to run.
Call the medium-term dude a “swapper” – there are two kinds of memory issues:
a. swapping – moving an entire program into/out of main memory. Due to low-priority or waiting for slow resources.
b. paging – this means the entire program/process isn’t moved – this is moving a part of it. There are two types of files: one is a “Swapped” file, and another is a page file. Swap files have partially-executed processes. The next time we run a process we don’t want just the partially-executed part. The OS manages the page files.
4. Hardware is a critical feature for preparing the CPU to begin the execution of interrupt servicing; because the state of the interrupted program could be destroyed by the interrupted service routine.
True.
Hardware needs to store at least where the prior process was. We need at least two pieces if info: the PSW and the program counter. The PSW can’t be stored by software.
5. Because of the overhead of context switching, programs that use concurrent processes will always take longer to execute than the same program with a single process.
False.
It takes longer to exec a context switch than not. IF a process blocks for I/O, another process gets to run. A program with multiple processes can perform other operations during I/O – i.e. while another process does I/O another process can do computational work. This allows less total time on the CPU overall, even with the overhead of context switching (especially if the two processes on one program share a lot of context).
6. To achieve high throughput, a multiprogramming OS assigns higher priority to CPU-bound programs.
False.
A compute-bound process will be a worse citizen if they never need to block for I/O. This means more leaving.
7. In general, CPU utilization increases as the degree of multiprogramming decreases.
False.
Programs naturally share the CPU if they’re waiting for I/O. The more multiprogramming, the less time the CPU is idle waiting for resources (i.e. disk access).
8. If we implement the consumer-producer problem with an unbounded bugger, we could expect that producter operations can always complete.
True
The unboundedness has no effect on the consumer.
9. Instructions like a ‘compare’ in assembly language, produce a side effect that saves the value of the arithmetic result in the PSW for use at a later time.
False.
Kind of tricky – Not the value. It does say if >0, overflow, etc, but not the value itself (look in the accumulator).
10. If a user program was able to access the processor status word for read and write, it would be able to ensure that it could keep control of the CPU forever.
True.
The CPU could always be “above” interrupts by default – if a user program is in charge of this it could exist in a state of highest priority.
So, I wanted to work on a little product photography, since today is an “off” day for me, I decided I’d take pictures of all the (screenprinted) t-shirts I currently am working with.
Here’s some fun facts:
Colors
RSS feed for comments on this post. / TrackBack URI