concurrent-programming: programs can run in independent with each other. parallel programming: program can run at same time.
as a low-level language, rust need less abstraction and more control.
use thread process vs thread
programs:
Race conditions: data-race. resource-race. DeakLock difficult concurrent bug. os-thread vs green-thread: 1:1 vs M:N
/// thread examples /// when the main-thread exit, the fork-thread will exit too. /// just like python thread.deamon flag. use std::thread; use std::time::Duration; fn main() { thread::spawn(|| { for i in 1.
concurrent-programming: programs can run in independent with each other. parallel programming: program can run at same time.
as a low-level language, rust need less abstraction and more control.
use thread process vs thread
programs:
Race conditions: data-race. resource-race. DeakLock difficult concurrent bug. os-thread vs green-thread: 1:1 vs M:N
/// thread examples /// when the main-thread exit, the fork-thread will exit too. /// just like python thread.deamon flag. use std::thread; use std::time::Duration; fn main() { thread::spawn(|| { for i in 1.