Skip to content

Commit

Permalink
feat: add resource clean up and warm up
Browse files Browse the repository at this point in the history
  • Loading branch information
tombelieber authored Jan 24, 2025
1 parent dd9c664 commit d3aadae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/o1_synchronizer_market_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ fn main() {
// `shm_path` is now a PathBuf
let shm_path = Arc::new(shm_path); // Arc<PathBuf>

// 在 main 开头清理旧共享内存:
let _ = fs::remove_file(&*shm_path);

// 添加预热迭代(不记录延迟):
for _ in 0..1000 {
synchronizer.write(&data, ...).unwrap();
}


// Add a shared 'done' flag so readers can stop
let done_flag = Arc::new(AtomicBool::new(false));

Expand Down

0 comments on commit d3aadae

Please sign in to comment.