You may use any resource that existed prior to this exam opening, including websites, books, etc; but should not consult friends, tutors, forums, or other interactive help for this exam.
You must not share any information about this exam (even how you felt about it) with any party (even others who have taken it) until after it closes at 2020-04-06 23:59 EDT.
Untrusted agent U sends me a message M and a message signature S created by agent A using public key K.
Assume
Give C-syntax Boolean expression, like M == Y(H(M),K)
, which is true if and only if the message was signed by A.
Which of the following should I definitely not get from U?
I eat a meal consisting of a bowl of soup and a bowl of ice cream, using the same spoon for both.
Which of the following is parallel but not concurrent?
Which of the following is concurrent but not parallel?
The following ask about several synchronization primitives
Which of the following is commonly used to create a simple blocking mutex?
The x86 instruction lock cmpxchg
is a hardware implementation of which of the following?
Which of the following does not block: that is, it never suspends a thread?
The following discuss caches
Set-associative caches are used instead of direct-mapped caches because set-associative caches
Which code has better locality?
Assume i
and j
are stored in registers and a
is a 10,000-element array.
Because 1009 is prime, the following will set all 1009 elements of a
to 0 as long as x
is not a multiple of 1009
:
for(int i=0; i<1009; i+=1)
a[(i*x)%1009] = 0;
Consider x
values 2, 31, and 505. Order these values from slowest to fastest assuming we have a
a
can fit in a single cache blockAssume that the (i*x)%1009
takes the same number of cycles regardless of the values of i
and x
.
Set-associative caches are used instead of fully-associative caches because set-associative caches
In your TLB code, you had no block offset because there was just one entry per block. We had just one entry per block because
Large cache blocks improve cache performance when the code exhibits
A memory leak in a process is limited to that process: when the process terminates, all its allocated memory will be reclaimed (that is, deallocated and made available to other processes).
If a thread has a memory leak,
How is process memory reclaimed?
The following are all of the form "inverting ____ requires". To invert function f we mean, given f(m), compute m. Assume that
Inverting a private-key encryption requires
Inverting a symmetric-key encryption requires
Inverting a cryptographically secure hash requires
Inverting a public-key encryption requires
If you have 52-bit addresses cached in a 16MB 8-way set-associative L2 cache with 64-byte blocks
The block offset is how many bits? Answer as a base-10 integer
The tag is how many bits? Answer as a C expression that evaluates to the correct number. You may use
52
bob
(the number of block offset bits)sib
(the number of set index bits)log2(n)
the log-base-2 of n
+
, -
, *
, /
, and <<
The set index is how many bits? Answer as a base-10 integer
The following ask about threading
In a multi-threaded environment, which of the following pairs of instructions always runs atomically; that is, that the result of running them is the same as if no other instructions were run in between them?
When running in user mode,
We often say that "each thread has its own stack memory"; we mean that each
Which of the following ensure that my code has no deadlocks?