Skip to content

Commit

Permalink
update a446525e849ab9fd7878fa241e42f76aee8e5fcf
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtomjhj committed Nov 28, 2023
1 parent 189ad68 commit 280479f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 1 addition & 2 deletions homework/doc/hash_table.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ We won't cover the weak memory semantics in this semester.
1. Fully understand the following reading materials.
+ [The original paper on the split-ordered list](https://dl.acm.org/doi/abs/10.1145/1147954.1147958).
You can skip the correctness proof and performance evaluation section.
Alternatively, read the chapter 13.3 of [The Art of Multiprocessor Programming](https://www.amazon.com/Art-Multiprocessor-Programming-Revised-Reprint/dp/0123973376).
Alternatively, read the chapter 13.3 of [The Art of Multiprocessor Programming](https://dl.acm.org/doi/book/10.5555/2385452).
It presents the same stuff, but is more readable.
[The PDF file](https://dl.acm.org/doi/book/10.5555/2385452) of the book can be downloaded for free in KAIST.
+ The [lock-free linked list](https://github.com/kaist-cp/cs431/blob/main/src/lockfree/list.rs) interface and implementation.
1. Implement `GrowableArray` in [`hash_table/growable_array.rs`](../src/hash_table/growable_array.rs). (about 100 LOC)
* You'll need to perform integer-pointer casts because `AtomicUsize` in `Segment` can be interpreted as both `Atomic<T>` and `Atomic<Segment>`.
Expand Down
2 changes: 2 additions & 0 deletions homework/doc/hello_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Specifically, make sure that you understand the following topics.
* [Channels](https://doc.rust-lang.org/std/sync/mpsc/index.html).
<!-- * The fact that there is no non-trivial way to break out of `TcpListener::incoming` loop. -->

See also: Rust book with quiz. <https://rust-book.cs.brown.edu/>

### Major differences between HW1 thread pool and Rust book §20 thread pool
1. We use [`crossbeam_channel`](https://docs.rs/crossbeam-channel/) instead of [<code>std::sync::<strong>mpsc</strong></code>](https://doc.rust-lang.org/std/sync/mpsc/index.html). Since crossbeam's channels are **mpmc**, you don't need to wrap the `Receiver` inside a `Mutex`.
1. We do not use explicit exit messages for the thread pool. Instead, we disconnect the channel by `drop`ping the receiver/sender.
Expand Down
4 changes: 4 additions & 0 deletions homework/scripts/grade-hazard_pointer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ run_linters || exit 1

export RUST_TEST_THREADS=1

TEMPLATE_REV=HEAD
check_diff ./src/hazard_pointer/hazard.rs 89
check_diff ./src/hazard_pointer/retire.rs 27

lines=$(grep_skip_comment transmute "$BASEDIR"/../src/hazard_pointer/{retire,hazard}.rs)
if [ -n "$lines" ]; then
echo "transmute() is not allowed."
Expand Down
6 changes: 4 additions & 2 deletions homework/scripts/grade-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ export -f echo_err
check_diff() {
local FILE=$1
local TAIL_N=$2
diff <(tail -n $TAIL_N <(git show $TEMPLATE_REV:$FILE)) <(tail -n $TAIL_N $FILE) \
|| (echo_err "You modified tests for ${FILE}!"; exit 1)
if ! diff -u <(tail -n "$TAIL_N" <(git show "$TEMPLATE_REV:$FILE")) <(tail -n "$TAIL_N" "$FILE"); then
echo_err "You modified tests for ${FILE}!"
exit 1
fi
}
export -f check_diff

Expand Down

0 comments on commit 280479f

Please sign in to comment.