Skip to content

Conversation

@qimcis
Copy link
Collaborator

@qimcis qimcis commented Jan 18, 2026

Description

Add CS350 Spring 2014 Midterm exam data and solution file to the courseexam benchmark.

Changes

  • Add exam files to /home/qi/system-intelligence-benchmark/benchmarks/courseexam_bench/data/raw/cs350_spring_2014_midterm
  • Add solutions file S14-midterm-sol.pdf
  • Add metadata entry for exam id cs350_spring_2014_midterm and title "CS350 Spring 2014 Midterm"

Testing

Prepared the dataset by running: python3 courseexam/prepare.py

Checklist

  • Tests pass locally
  • Code follows project style guidelines
  • Documentation updated (if needed)

Copy link
Collaborator

@777lefty 777lefty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some format issues and missing issues, and the problem-subproblem structure seems not to be consistent


---

## Question 1a [2 point(s)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Background information for all subproblems in problem 1 is missed


## Question 1b [2 point(s)]

b. (2 marks)Show the output that will be produced when this program runs. Note that the statement printf(\"%d\",i); will print the value of integer variable i. You should show the combined output of all processes. Your answer should be a single sequence of numbers.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code block here better


---

## Question 2a [5 point(s)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

background information for all subproblems in problem 2 is missed

## Question 2a [5 point(s)]

a. (5 marks)In the space below, implement the lock tryacquire function, which has the following prototype:
int locktryacquire(struct lock *lock);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code block here better

## Question 2b [5 point(s)]

b. (5 marks)Suppose that a set of threads is using multiple locks for synchronization. In most cases, threads will acquire and release one lock at a time, using lockacquire and lockrelease. However, in some situations it is necessary for a thread to acquire two locks simultaneously. Write a function called acquiretwolocks that a thread can call to lock two different locks. The function prototype should be as follows:
void acquiretwolocks(struct lock *L1, struct lock *L2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code block here better

// set the value in R1 to 1 to indicate success. Otherwise,
// do not change the value of the lock variable and set the value
// of R1 to 0 to indicate failure.
sc R1,&lock
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code block here better

Crunchers never block. When they are chosen to run by the scheduler, they will run until they are preempted. Talkers, on the other hand, continuously output characters, as illustrated by the following pseudo-code:
while (true){
/* output a character */
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code block here better


Do not use any synchronization primitives other than semaphores in your solution. Do not make any changes to the skeleton code other than inserting calls to semaphore operations.

(Skeleton implementations and declarations are provided to students; do not provide solutions in the exam text here.)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's neither included here nor provided anywhere else?


Do not use any synchronization primitives other than semaphores in your solution. Do not make any changes to the skeleton code other than inserting calls to semaphore operations.

(Skeleton implementations and declarations are provided to students; do not provide solutions in the exam text here.)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's neither included here nor provided anywhere else?


## Question 7a [3 point(s)]

a. (3 total marks)Which of the following effects does a MIPS syscall instruction have when it is executed? (Note: we are interested only in the effects of this single instruction, not the effects of any code that runs after this instruction.) Circle all that apply.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can ask agent to output the items that apply rather than circle them here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants