uncomment some of the threads examples

they don't run yet because of some stack size thing
This commit is contained in:
ahgamut 2022-09-08 09:49:12 +05:30
parent 4e2d12b531
commit 4b8d56098f
6 changed files with 16 additions and 24 deletions

View file

@ -1,6 +1,5 @@
// ./src/std/arc.md // ./src/std/arc.md
/*
use std::time::Duration; use std::time::Duration;
use std::sync::Arc; use std::sync::Arc;
use std::thread; use std::thread;
@ -24,9 +23,8 @@ fn part0() {
// Make sure all Arc instances are printed from spawned threads. // Make sure all Arc instances are printed from spawned threads.
thread::sleep(Duration::from_secs(1)); thread::sleep(Duration::from_secs(1));
} }
*/
pub fn main() { pub fn main() {
// part0(); part0();
} }

View file

@ -1,6 +1,5 @@
// ./src/std/hash/alt_key_types.md // ./src/std/hash/alt_key_types.md
/*
use std::collections::HashMap; use std::collections::HashMap;
// Eq requires that you derive PartialEq on the type. // Eq requires that you derive PartialEq on the type.
@ -56,9 +55,9 @@ fn part0(){
try_logon(&accounts, "j.everyman", "psasword123"); try_logon(&accounts, "j.everyman", "psasword123");
try_logon(&accounts, "j.everyman", "password123"); try_logon(&accounts, "j.everyman", "password123");
}*/ }
pub fn main() { pub fn main() {
// part0(); part0();
} }

View file

@ -1,6 +1,5 @@
// ./src/std_misc/channels.md // ./src/std_misc/channels.md
/*
use std::sync::mpsc::{Sender, Receiver}; use std::sync::mpsc::{Sender, Receiver};
use std::sync::mpsc; use std::sync::mpsc;
use std::thread; use std::thread;
@ -48,9 +47,8 @@ fn part0() {
// Show the order in which the messages were sent // Show the order in which the messages were sent
println!("{:?}", ids); println!("{:?}", ids);
} }
*/
pub fn main() { pub fn main() {
// part0(); part0();
} }

View file

@ -2,7 +2,7 @@
use std::process::Command; use std::process::Command;
/*
fn part0() { fn part0() {
let output = Command::new("rustc") let output = Command::new("rustc")
.arg("--version") .arg("--version")
@ -19,9 +19,9 @@ fn part0() {
print!("rustc failed and stderr was:\n{}", s); print!("rustc failed and stderr was:\n{}", s);
} }
}*/ }
pub fn main() { pub fn main() {
// part0(); part0();
} }

View file

@ -1,6 +1,5 @@
// ./src/std_misc/threads.md // ./src/std_misc/threads.md
/*
use std::thread; use std::thread;
const NTHREADS: u32 = 10; const NTHREADS: u32 = 10;
@ -21,9 +20,9 @@ fn part0() {
// Wait for the thread to finish. Returns a result. // Wait for the thread to finish. Returns a result.
let _ = child.join(); let _ = child.join();
} }
} */ }
pub fn main() { pub fn main() {
// part0(); part0();
} }

View file

@ -1,6 +1,5 @@
// ./src/std_misc/threads/testcase_mapreduce.md // ./src/std_misc/threads/testcase_mapreduce.md
/*
use std::thread; use std::thread;
// This is the `main` thread // This is the `main` thread
@ -92,10 +91,9 @@ fn part0() {
println!("Final sum result: {}", final_result); println!("Final sum result: {}", final_result);
} }
*/
pub fn main() { pub fn main() {
// part0(); part0();
} }