Docsity

Practice Quiz 5 - Computer Organization and Systems Program | CSE 30, Quizzes of Computer Science

Toggle sidebar
bg1
Name:
cs30x____
Score:
Quiz 5
CSE 30
Winter 2001
#1. Which type of cache is more efficient for programs which may perform many writes to the same temporary
short-lived variables that do not need to be saved.
_________________________________
#2. List 3 ways/events which would cause a context switch to occur.
1)
2)
3)
#3. Given the following program, reorder the printf lines so that the values that are printed are sorted from small-
est to largest.
int x = 5;
int
main( int argc, char *argv[] ) {
int a;
static int b;
/* 1 */ (void) printf( "a --> %p\n", &a );
/* 2 */ (void) printf( "b --> %p\n", &b );
/* 3 */ (void) printf( "x --> %p\n", &x );
/* 4 */ (void) printf( "argc --> %p\n", &argc );
/* 5 */ (void) printf( "main --> %p\n", main );
/* 6 */ (void) printf( "malloc --> %p\n", malloc(50) );
}
___________ This line number would print the smallest value
___________
___________
___________
___________
___________ This line number would print the largest value
(over)
pf2

Partial preview of the text

Download Practice Quiz 5 - Computer Organization and Systems Program | CSE 30 and more Quizzes Computer Science in PDF only on Docsity!

Name:

cs30x____

Score:

Quiz 5

CSE 30

Winter 2001

#1. Which type of cache is more efficient for programs which may perform many writes to the same temporary

short-lived variables that do not need to be saved.

_________________________________

#2. List 3 ways/events which would cause a context switch to occur.

#3. Given the following program, reorder the printf lines so that the values that are printed are sorted from small-

est to largest.

int x = 5;

int main( int argc, char *argv[] ) {

int a; static int b;

/* 1 / (void) printf( "a --> %p\n", &a ); / 2 / (void) printf( "b --> %p\n", &b ); / 3 / (void) printf( "x --> %p\n", &x ); / 4 / (void) printf( "argc --> %p\n", &argc ); / 5 / (void) printf( "main --> %p\n", main ); / 6 */ (void) printf( "malloc --> %p\n", malloc(50) ); }

___________ This line number would print the smallest value

___________

___________

___________

___________

___________ This line number would print the largest value

(over)

What question would you most like to see on the Final Exam?