You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for tunnel.c please have the students print out if an ambulance or car wants to enter the tunnel. I can add a check to the autograder to see if a car goes in if an ambulance is waiting.
Car (1) entered tunnel in EW direction...
Car (2) entered tunnel in EW direction...
Car (3) entered tunnel in EW direction...
Car (16) entered tunnel in WE direction...
Ambulance 31 waiting to enterer the tunnel in WE direction
Car (4) waiting to enter tunnel in EW direction...
Car (16) exited tunnel in WE direction...
Ambulance 31 entered the tunnel in WE direction
Car (2) exited tunnel in EW direction...
Car (1) exited tunnel in EW direction...
Car (3) exited tunnel in EW direction...
Ambulance 31 exited the tunnel in WE direction
typo:
misspelled unhappy in .c file and assignment output
// printf("[Customer %ld] Left unhapy because waiting room is full...\n", tid);
Most common bugs/warnings for condvars basic
sleeping while holding lock
lock before checking vars in if or while loops
inorder.c:
people forget they should have used broadcast instead of signal.
If the threads came in reverse order (4,3,2,1) it would cause a deadlock
tunnel.c:
There were many times when people forget to let waiting ambulance have priority
Sometimes people did not add an ambulance to the tunnel count and only added it to an ambulances count.
So ambulance has a chance to slip through. For example: EW=2, WE=0, ambulance=3
ewcars and ambulances should be broadcast cuz there is a chance that a lane opens but the car waits.
For example: say only 1 ambulance is in the tunnel and 3 ew cars pull out outside waiting cuz of the ambulance. Then when the ambulance leaves it only signals to one car and the other 2 just wait.
Tests that should be added:
inorder.c:
send threads in reverse order
tunnel.c:
have 2 EW cars go in then send 3 ambulances go in and check if 5 cars somehow end up in the tunnel
Have 1 ambulance go in and have 3 cars wait outside. Then when the ambulance leaves check if all three cars go in.
Condvars 2
There were many cases where people got docked for putting their print statements in the wrong place.
Have it so that the print and sleep statements are wrapped in a function, called critical_section() or something, so to the students
it would seem more important and place it in the correct position. Doing this also will help with the autograder because
sometimes people forget to put in print statements and the autograder would mark it as wrong.
hen.c:
Be clear that animals stay in the kitchen when waiting after complaining for bread
- ❓ How does the xv6 kernel handle scheduling on multiple CPUs?
be more explicit with how the casting of list_head to proc* works. Many students missed that section. Like have a mention of this outside of the api demo.
- Add a `struct list_head` to the process control block (make sure that it is
explain what userinit and procinit do or at least say that these functions only run once at the beginning and
students could potently put init code in there.
Have a better pseudo-code explanation of runq.
For example, make this analogy:
There are 4 chefs in the kitchen(harts)
and they get a queue of orders coming in. Each chef takes the first order of
that queue and starts working. Then hint that to add to the queue a proc must be marked RUNNABLE.
Since 2 chefs can't take the same order at the same time they need to lock.
In the end, just communicate these 2 things:
scheduler() just pops off the queue
everywhere else just pushes to the tail of the queue
- Anytime a process becomes ready to be executed, add it to the run queue. This
Add hints that there won't be big modifications to most functions(only around 6).
Reminder users how to search in vim (use "/") and to just search RUNNABLE as a hint.
Remind students that they can use procdump for debugging
Remind students that they need to also lock when the scheduler is checking when the queue is empty.
Many people forget and only lock when popping from the queue.
Clarify that you only need to run usertests forkforkfork nothing else because some people ran usertests at the end
Suggested HW changes
Condvars basic
for tunnel.c please have the students print out if an ambulance or car wants to enter the tunnel. I can add a check to the autograder to see if a car goes in if an ambulance is waiting.
csse332/labs/condvar/tunnel.c
Line 53 in 5e639c2
for example:
typo:
csse332/labs/condvar/rooms.c
Line 37 in 4566802
Most common bugs/warnings for condvars basic
inorder.c:
If the threads came in reverse order (4,3,2,1) it would cause a deadlock
tunnel.c:
So ambulance has a chance to slip through. For example: EW=2, WE=0, ambulance=3
For example: say only 1 ambulance is in the tunnel and 3 ew cars pull out outside waiting cuz of the ambulance. Then when the ambulance leaves it only signals to one car and the other 2 just wait.
Tests that should be added:
inorder.c:
tunnel.c:
Condvars 2
There were many cases where people got docked for putting their print statements in the wrong place.
Have it so that the print and sleep statements are wrapped in a function, called
critical_section()
or something, so to the studentsit would seem more important and place it in the correct position. Doing this also will help with the autograder because
sometimes people forget to put in print statements and the autograder would mark it as wrong.
hen.c:
csse332/labs/condvar_challenge/index.md
Line 140 in 5e639c2
Tests that should be added:
hen.c:
Scheduler hw
This list just contains the most common misconceptions I saw when helping others complete the lab:
Please better emphasize user should be on klist branch. Some people just skip the top part of the lab?
mini btop guide like how to search with f -> arrows keys -> hit enter
csse332/labs/sched/index.md
Line 134 in 5e639c2
without wfi
correct solution:
Say to read only ch 7.3 not just ch 7
csse332/labs/sched/index.md
Line 99 in 5e639c2
Clarify that CPUs stand for cores
csse332/labs/sched/index.md
Line 109 in 5e639c2
be more explicit with how the casting of
list_head
toproc*
works. Many students missed that section. Like have a mention of this outside of the api demo.csse332/labs/sched/index.md
Line 252 in 4566802
remove the iteration example because it is easier to just pop of the queue
This is bc people will implement an iterator when doing the assignment
csse332/labs/sched/index.md
Line 255 in 5e639c2
Change the wording of "process control block" to struct many people were confused
csse332/labs/sched/index.md
Line 272 in 4566802
explain what userinit and procinit do or at least say that these functions only run once at the beginning and
students could potently put init code in there.
Have a better pseudo-code explanation of runq.
For example, make this analogy:
There are 4 chefs in the kitchen(harts)
and they get a queue of orders coming in. Each chef takes the first order of
that queue and starts working. Then hint that to add to the queue a proc must be marked RUNNABLE.
Since 2 chefs can't take the same order at the same time they need to lock.
In the end, just communicate these 2 things:
csse332/labs/sched/index.md
Line 166 in 5e639c2
csse332/labs/sched/index.md
Line 277 in 4566802
Add hints that there won't be big modifications to most functions(only around 6).
Reminder users how to search in vim (use "/") and to just search RUNNABLE as a hint.
Remind students that they can use procdump for debugging
Remind students that they need to also lock when the scheduler is checking when the queue is empty.
Many people forget and only lock when popping from the queue.
Clarify that you only need to run
usertests forkforkfork
nothing else because some people ranusertests
at the endcsse332/labs/sched/index.md
Line 330 in 5e639c2
typos:
line 437 of proc.c typo "isse" should be issue?
https://github.com/rhit-csse332/csse332-labs/blob/22467ef69fc1ef47933b70edd0d2d05a47671b69/xv6-riscv/kernel/proc.c#L437
Misspelled
supports
in synchronization sectioncsse332/labs/sched/index.md
Line 298 in 5e639c2
The text was updated successfully, but these errors were encountered: