ECE454, Fall 2025
University of Toronto
Instructors:
Ashvin Goel,
Ding Yuan
Q: Is this lab competitive?
A: No.
Q: Do we need to clean up the hash tables (and other structures)? The original implementation doesn't but the hash.h implementation exposes such functions. I am wondering since it may affect timing.
A: You don't need to clean up the hash tables.
Q: Do we comment out h.print() for timing measurements since it may affect timing measurements?
A: Please don't comment out the print statement.
Q: Q2 asks whether we are able to implement list-level locks without modifying the hash class, or without knowing its internal implementation. What does it mean to not know the internal implementation?
A: Assume you know about the public methods in the hash class (e.g., their type and purpose) but not how they are implemented (e.g., using and array and linked lists).
Q: With element level locks, how do you synchronize without holding a list-level lock?
A: There are several options, including using hand-over-hand locking, holding a list-level lock in some situations, using atomic operations (not discussed in class yet).
Q: With the reduction approach, it seems that the sample collection stage is multi-threaded while the reduction stage is performed by one thread. Should the reduction stage be parallelized as well?
A: We don't expect you to parallelize it but you are welcome to do it.
Q: Should code by commented?
A: You'd be doing yourself a huge favor by commenting your code and keeping it clean and organized. If we suspect you of cheating, you must be able to clearly describe what you were doing and tell us exactly what your code does.
Q: Is this lab automarked?
A: No.
Q: Is there a template for report.txt?
A: Write it in a format so that it is easy for TAs to mark your report. Please don't write long paragraphs.
Q: how is Lab 4 marked?
We mark it based on whether we think that you understood the concepts. If you answer the questions in a few clear and concise points, you'll receive full marks for the answers.
For the various program versions, we will look at your plots. If we are not satisfied with the plots, we will look at your implementation.
This lab is relatively easy and students generally score well in this lab. We have designed it so that you learn to write parallel code, which will help with Lab 5.