From 4dd13b98997454e88a0374b16a5f3a0390d7c33f Mon Sep 17 00:00:00 2001 From: mohanson Date: Mon, 6 May 2024 16:31:13 +0800 Subject: [PATCH] Add constraints descriptions for process and pipe. --- rfcs/0050-vm-syscalls-3/0050-vm-syscalls-3.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rfcs/0050-vm-syscalls-3/0050-vm-syscalls-3.md b/rfcs/0050-vm-syscalls-3/0050-vm-syscalls-3.md index 073870ec..30db06dc 100644 --- a/rfcs/0050-vm-syscalls-3/0050-vm-syscalls-3.md +++ b/rfcs/0050-vm-syscalls-3/0050-vm-syscalls-3.md @@ -70,10 +70,15 @@ The arguments used here are: The arguments used here - index, source, bounds, place, argc, and argv - follow the usage described in [EXEC]. +There are some hard limits to the system to avoid the overuse of resources. + +- CKB-VM allows 16 processes to exist at the same time (excluding the root process). Processes that are created but exit normally will not be counted. +- A maximum of 4 instantiated VMs is allowed. Each process needs to occupy a VM instance to run. When the number of processes is greater than 4, some processes will enter a state called "uninstantiated". CKB-VM implements a scheduler to decide which processes should be "instantiated" and which processes should be "uninstantiated". However, switching the instantiation state of a VM is very expensive, developers should try to keep the number of processes below 4 so that all processes are instantiated. + ### Pipe [Pipe]: #pipe -This syscall create a pipe with read-write pair of file descriptions. The file descriptor with read permission is located at `fds[0]`, and the corresponding file descriptor with write permission is located at `fds[1]`. +This syscall create a pipe with read-write pair of file descriptions. The file descriptor with read permission is located at `fds[0]`, and the corresponding file descriptor with write permission is located at `fds[1]`. A maximum of 64 file descriptors can exist at the same time. ```c int ckb_pipe(uint64_t fds[2]);