随笔分类 -  rust

pop operation of singly linked list in rust
摘要:![image](https://img2024.cnblogs.com/blog/731236/202503/731236-20250316173437166-1639922758.png) 阅读全文

posted @ 2025-03-16 17:34 winter-loo 阅读(6) 评论(0) 推荐(0)

false sharing in Rust
摘要:How to optimize the program below to run faster? use std::{thread, sync::Arc}; use std::sync::atomic::AtomicU64; struct Block { d1: AtomicU64, } fn wo 阅读全文

posted @ 2024-08-26 03:11 winter-loo 阅读(14) 评论(0) 推荐(0)

[tokio] Runtime 初始化
摘要:demo #[tokio::main] async fn main() { println!("Hello world"); } Equivalent code not using #[tokio::main] fn main() { tokio::runtime::Builder::new_mul 阅读全文

posted @ 2024-08-18 23:00 winter-loo 阅读(37) 评论(0) 推荐(0)

size of rust closure
摘要:principle https://doc.rust-lang.org/reference/types/closure.html?highlight=fnonce#closure-types demo 1 fn f<F : FnOnce() -> String> (g: F) { println!( 阅读全文

posted @ 2024-08-18 04:13 winter-loo 阅读(7) 评论(0) 推荐(0)

导航