← Back to all sparks
P

ps

DEVOPS
Velocity0.0

Query, list and manipulate system processes from R across platforms

ps grew from a process inspector into the thing that reliably kills what you started.

processesr-libprocessxcross-platformprocess-controlcorrectness
Current state
ps is the cross-platform process API underneath processx and callr, and its recent work splits between widening what it can query and hardening the guarantee that a handle still refers to the process you think it does. Version 1.8.0 added interruptible multi-process waiting, vectorised signalling, and graceful kill with a TERM-then-KILL grace period. Version 1.9.3 rebuilt Linux process creation times on a clock pair instead of integer-second boot time, closing a window where two processes could look identical.
Where it's heading
The direction is from observation to control. Early releases in view are per-process queries — CPU times, memory, affinity — and the newer ones are orchestration: wait on many processes with a timeout, signal a list of handles at once, terminate a tree politely before forcing it. The create-time precision work is what makes that safe, since a handle's identity is a PID plus a start time, and a one-second resolution start time is not enough to rule out PID reuse on a busy machine.
Prediction
Expect the remaining platform-specific gaps in ps_status() and ps_apps() to close before any new capability area opens, since the recent additions have all been driven by processx issue reports.

Recent moves

  1. 3mo ago

    Sub-second process create times on Linux

    Replaces /proc/stat boot time with CLOCK_REALTIME minus CLOCK_MONOTONIC to compute Linux process create times, giving sub-second precision where integer-second boot time previously allowed up to a full second of error. Handle validation accepts both the new and legacy values so existing processx handles keep working. This is the identity guarantee that stops a signal landing on a recycled PID.

    View source ↗
  2. 4mo ago

    ps_string() for unique process identification

    Adds ps_string() to uniquely identify a process, a small addition that fits the same identity concern the create-time work addresses. Contributed from outside the maintainer team.

    View source ↗
  3. 1y ago

    Build correctly on Alpine Linux

    A build fix so the package compiles on Alpine Linux 3.19 under R 4.5.0. Platform upkeep with no behavioural change.

    View source ↗
  4. 1y ago

    maxrss reporting and selectable columns in ps()

    Adds maxrss to ps_memory_full_info() and a columns argument to ps() so callers can choose what data is collected. The columns argument matters for cost — a full process table is expensive to assemble on every poll.

    View source ↗
  5. 1y ago

    Installable again on unsupported platforms

    Restores the ability to install ps on unsupported platforms, where it presumably degrades rather than failing to build. Packaging fix only.

    View source ↗
  6. 1y ago

    Multi-process waiting, vectorised signals and graceful kill

    ⚡ SPARK

    The release that turns ps from a query library into a process-control library: interruptible multi-process waits, vectorised signalling over handle lists, and graceful termination with a grace period. Everything since has been about making those operations safe to trust.

    View source ↗