Skip to content

Remove PIDs from processes

Yorick Peterse requested to merge processes-without-pids into master

Details

This removes the use of PIDs for processes in favour of using proper process objects. This means we no longer need to allocate PIDs. This allows us to spawn processes without having to obtain a lock on a global process table.

The removal of PIDs means that sending messages feels a bit nicer now. Instead of writing this:

import std::process

let pid = process.spawn {}

process.send(pid: pid, message: 'hello')

You now write this instead:

import std::process

let proc = process.spawn {}

proc.send('hello')

We also remove the std::process.channel method and associated types. This API was not very pleasant to use, and was not very efficient either. We hope to (re-)introduce a better type-safe API for message passing in the future, if possible.

Corresponding issue

#161 (closed)

Checklist

Edited by Yorick Peterse

Merge request reports