top | item 40148485

(no title)

alakra | 1 year ago

Somewhat related, does anyone know the difference between `erlang:suspend_process` and `sys:suspend` when trying trying to "unschedule" a process for executing reductions? Are they the same thing?

discuss

order

yetihehe|1 year ago

sys:suspend is more low-level. erlang:suspend_process is also tracking which processes suspended a process, so you can suspend from multiple places and if all suspending processes terminate, it will automatically unsuspend the suspended one. Probably erlang:suspend_process uses sys:suspend when counter is >1 and sys:resume when counter reaches 0.