mirror of
https://github.com/ahgamut/rust-ape-example.git
synced 2024-12-04 06:16:39 +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
|
// ./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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue