Log sends ever 100 pids to monitor for stalls
@@ -129,7 +129,17 @@ fn counter_2_code(arc_process: &Arc<ProcessControlBlock>) -> Result {
Atom::try_from_str("erlang").unwrap(),
Atom::try_from_str("send").unwrap(),
2,
- || match erlang::send_2(next_pid, sum, arc_process) {
+ || {
+ // printing is slow, so print to show progress, but not too often that is slows down a
+ // lot.
+ if arc_process.pid().number() % 1_000 == 0 {
+ system::io::puts(&format!(
+ "{:?} Sending {:?} to {:?}",
+ arc_process, sum, next_pid
+ ));
+ }
+
+ match erlang::send_2(next_pid, sum, arc_process) {
Ok(term) => Ok(term),
Err(error) => {
system::io::puts(&format!(
@@ -143,6 +153,7 @@ fn counter_2_code(arc_process: &Arc<ProcessControlBlock>) -> Result {
));
Err(error)
}
+ }
},
)
}
