Last active
June 25, 2018 18:04
-
-
Save c16a/1cb8bf51c856ec89b152d09357f6c81f to your computer and use it in GitHub Desktop.
Asynchronous programming using higher-order functions in post-2010 languages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
async { | |
print("Printing GeeksQuiz from thread") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::thread; | |
fn main() { | |
println!("Before thread"); | |
// fill the vector | |
let handle = thread::spawn(|| { | |
println!("Printing GeeksQuiz from threads"); | |
}) | |
println!("After thread"); | |
handle.join().unwrap(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment