Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 1.32 KB

230330.containers.md

File metadata and controls

23 lines (17 loc) · 1.32 KB

2023-03-30

Communicating between containers: https://github.com/toitlang/toit/blob/master/examples/service.toit

https://discordapp.com/channels/918498540232253480/1025033748661665792/1090917500599947326

RobvanLopik

From the above I would infer that "process" is equivalent to "container". Is that true?

kasperl

@RobvanLopik Almost, but not entirely. We allow multiple processes within one container, but it is somewhat uncommon to use.
So typically there is a one-to-one correspondance.
Using spawn doesn't really create a new container, but it does start another process from within the same container.

RobvanLopik

This raises the question how processes and containers are scheduled. And how this relates to tasks. Probably is has been written down somewhere, but I could do with a 101.

kasperl

Containers are scheduled with triggers that govern starting and stopping.
Within the containers, the processes have priorities and are scheduled without taking containers into account (one pool of prioritized processes).
The scheduling of processes is preemptive and runs across multiple cores in parallel.
Within a process, the tasks are cooperatively scheduled with a simple round-robin strategy.
We go to the next task when yielding, blocking or (often) leaving synchronization primitives (monitors).