Final Exam Solutions
CS 213 Spring 2004
Copyright By PowCoder代写 加微信 powcoder
line# | fd1 | fd2 | fd3 | [foo].pos | [foo].refcnt | [bar].pos| [bar].refcnt
line 6 | [foo] | ——- | ——- | 0 | 1 | ——- | ——-
line 13 | [foo] | ——- | [bar] | 0 | 2 | 0 | 1
line 14 | [bar] | ——- | [bar] | 0 | 1 | 0 | 2
line \# | fd1 | fd2 | fd3 | [foo].pos | [foo].refcnt | [bar].pos | [bar].refcnt
line 8 | [foo] | ——- | ——- | 0 | 2 | ——- | ——-
line 9 | [foo] | ——- | ——- | 0 | 2 | ——- | ——-
A. It guarantees that all the data is transmitted, but write()
192.168.0.1 | 192.168.0.2
hello world[return] | hello world[return]
1. bar(str=“Walrus”, dp=0xdeadbeef)
2. hammer(a=15, c=’-‘, i=213)
3. main(argc=2, argv=[“/bin/foo”, “Lock”, (NULL)])
4. Space not needed
A. Immediate coalescing – you have no idea how long deferred
coalescing will take… immediate is O(1)…
B. There is no difference since you’re using free space (you have a
minimum block size of 32 bytes).
C. Using 8 segregated lists – one for each size.
foo1(int N, int M, int* a, int *b, int *e)
int i,j,k;
int iMj = 0;
int iM = 0;
int eiMj1,eiMj2;
for (i=0; i