mirror of
https://github.com/ahgamut/rust-ape-example.git
synced 2024-12-03 13:56:40 +00:00
uncomment some of the threads examples
they don't run yet because of some stack size thing
This commit is contained in:
parent
4e2d12b531
commit
4b8d56098f
6 changed files with 16 additions and 24 deletions
|
@ -1,6 +1,5 @@
|
|||
// ./src/std/arc.md
|
||||
|
||||
/*
|
||||
use std::time::Duration;
|
||||
use std::sync::Arc;
|
||||
use std::thread;
|
||||
|
@ -24,9 +23,8 @@ fn part0() {
|
|||
// Make sure all Arc instances are printed from spawned threads.
|
||||
thread::sleep(Duration::from_secs(1));
|
||||
}
|
||||
*/
|
||||
|
||||
pub fn main() {
|
||||
// part0();
|
||||
part0();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// ./src/std/hash/alt_key_types.md
|
||||
|
||||
/*
|
||||
use std::collections::HashMap;
|
||||
|
||||
// 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", "password123");
|
||||
}*/
|
||||
|
||||
pub fn main() {
|
||||
// part0();
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
part0();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// ./src/std_misc/channels.md
|
||||
|
||||
/*
|
||||
use std::sync::mpsc::{Sender, Receiver};
|
||||
use std::sync::mpsc;
|
||||
use std::thread;
|
||||
|
@ -48,9 +47,8 @@ fn part0() {
|
|||
// Show the order in which the messages were sent
|
||||
println!("{:?}", ids);
|
||||
}
|
||||
*/
|
||||
|
||||
pub fn main() {
|
||||
// part0();
|
||||
part0();
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
|
||||
use std::process::Command;
|
||||
/*
|
||||
|
||||
fn part0() {
|
||||
let output = Command::new("rustc")
|
||||
.arg("--version")
|
||||
|
@ -19,9 +19,9 @@ fn part0() {
|
|||
|
||||
print!("rustc failed and stderr was:\n{}", s);
|
||||
}
|
||||
}*/
|
||||
|
||||
pub fn main() {
|
||||
// part0();
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
part0();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// ./src/std_misc/threads.md
|
||||
|
||||
/*
|
||||
use std::thread;
|
||||
|
||||
const NTHREADS: u32 = 10;
|
||||
|
@ -21,9 +20,9 @@ fn part0() {
|
|||
// Wait for the thread to finish. Returns a result.
|
||||
let _ = child.join();
|
||||
}
|
||||
} */
|
||||
|
||||
pub fn main() {
|
||||
// part0();
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
part0();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// ./src/std_misc/threads/testcase_mapreduce.md
|
||||
|
||||
/*
|
||||
use std::thread;
|
||||
|
||||
// This is the `main` thread
|
||||
|
@ -92,10 +91,9 @@ fn part0() {
|
|||
|
||||
println!("Final sum result: {}", final_result);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
pub fn main() {
|
||||
// part0();
|
||||
part0();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue