When Viua code calls a foreign function, store the request on a foreign call request vector.
After all Viua processes finished running in the current burst, execute the calls to foreign functions - after a foreign call returns carry the return value to the requesting process and wake it up.
If this mechanism is implemented cleanly, it will be quite easy to push it to separate thread inside the VM and run the code concurrently.
When Viua code calls a foreign function, store the request on a foreign call request vector. After all Viua processes finished running in the current burst, execute the calls to foreign functions - after a foreign call returns carry the return value to the requesting process and wake it up.
If this mechanism is implemented cleanly, it will be quite easy to push it to separate thread inside the VM and run the code concurrently.