From f9f0511770e07c741e64777d664f273afc29c43e Mon Sep 17 00:00:00 2001 From: Jaehwang Jung Date: Mon, 4 Dec 2023 12:15:54 +0900 Subject: [PATCH] update 30b0f4d8ecfa2365affe241812e78bfb8fdf7e32 --- homework/Cargo.toml | 9 +++------ homework/tests/growable_array.rs | 10 ++++++---- homework/tests/split_ordered_list.rs | 10 ++++++---- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/homework/Cargo.toml b/homework/Cargo.toml index cfed53de7d..6cc74e1c26 100644 --- a/homework/Cargo.toml +++ b/homework/Cargo.toml @@ -8,16 +8,13 @@ edition = "2021" check-loom = ["loom"] [dependencies] -arr_macro = "0.2.1" cfg-if = "1.0.0" crossbeam-channel = "0.5.8" crossbeam-epoch = "0.9.15" crossbeam-utils = "0.8.16" -ctrlc = "3.4.0" -either = "1.9.0" -itertools = "0.11.0" +ctrlc = "3.4.1" cs431 = { git = "https://github.com/kaist-cp/cs431" } # cs431 = { path = "../cs431" } -loom = { version = "0.7.0", optional = true } +loom = { version = "0.7.1", optional = true } rand = "0.8.5" -regex = "1.9.3" +regex = "1.10.2" diff --git a/homework/tests/growable_array.rs b/homework/tests/growable_array.rs index d3c68bb17b..0f6d8529e3 100644 --- a/homework/tests/growable_array.rs +++ b/homework/tests/growable_array.rs @@ -1,3 +1,5 @@ +#![feature(cfg_sanitize)] + use core::mem::{self, ManuallyDrop}; use core::ptr; use core::sync::atomic::Ordering; @@ -163,14 +165,14 @@ fn insert_concurrent() { #[test] fn stress_concurrent() { - const THREADS: usize = 16; - const STEPS: usize = 4096 * 512; + const THREADS: usize = if cfg!(sanitize = "thread") { 4 } else { 16 }; + const STEPS: usize = 4096 * if cfg!(sanitize = "thread") { 128 } else { 512 }; map::stress_concurrent::>>(THREADS, STEPS); } #[test] fn log_concurrent() { - const THREADS: usize = 16; - const STEPS: usize = 4096 * 12; + const THREADS: usize = if cfg!(sanitize = "thread") { 4 } else { 16 }; + const STEPS: usize = 4096 * if cfg!(sanitize = "thread") { 16 } else { 64 }; map::log_concurrent::>>(THREADS, STEPS); } diff --git a/homework/tests/split_ordered_list.rs b/homework/tests/split_ordered_list.rs index ebb8da9a0c..ca468b6053 100644 --- a/homework/tests/split_ordered_list.rs +++ b/homework/tests/split_ordered_list.rs @@ -1,3 +1,5 @@ +#![feature(cfg_sanitize)] + use crossbeam_epoch as epoch; use cs431_homework::test::adt::map; @@ -55,8 +57,8 @@ fn insert_concurrent() { #[test] fn stress_concurrent() { - const THREADS: usize = 16; - const STEPS: usize = 4096 * 512; + const THREADS: usize = if cfg!(sanitize = "thread") { 4 } else { 16 }; + const STEPS: usize = 4096 * if cfg!(sanitize = "thread") { 128 } else { 512 }; map::stress_concurrent::>>( THREADS, STEPS, ); @@ -64,8 +66,8 @@ fn stress_concurrent() { #[test] fn log_concurrent() { - const THREADS: usize = 16; - const STEPS: usize = 4096 * 64; + const THREADS: usize = if cfg!(sanitize = "thread") { 4 } else { 16 }; + const STEPS: usize = 4096 * if cfg!(sanitize = "thread") { 16 } else { 64 }; map::log_concurrent::>>( THREADS, STEPS, );