archseer / enigma

An Erlang VM implementation in Rust
Mozilla Public License 2.0
1.05k stars 39 forks source link

Timers #12

Open archseer opened 5 years ago

archseer commented 5 years ago

Timers includes:

As well as WaitTimeout and Send with timeout instructions. The implementation should use a hierarchical timing wheel, can probably base the implementation on https://github.com/tokio-rs/tokio/tree/master/tokio-timer/src/wheel

If we decide to integrate with Tokio for the async I/O (yields the BIF when blocking), we could avoid copying the impl. If we copy it, we probably want a new thread that will keep track of the wheel and schedule processes when their timers are up (similar to what process::spawn internals do)

archseer commented 5 years ago

Simple send_after was implemented, but no way to cancel or manipulate timers yet.