Class AixOSProcess

All Implemented Interfaces:
OSProcess

@ThreadSafe public abstract class AixOSProcess extends AbstractProcOSProcess
Abstract base for AIX OSProcess. The /proc parsing, command-line/env memoization, thread enumeration, and field assignment are shared (via AbstractProcOSProcess); concrete subclasses (JNA/FFM) provide the perfstat lookup, the rlimit read, the affinity supplier, and the actual queryArgsEnv address-space read.
  • Constructor Details

    • AixOSProcess

      protected AixOSProcess(int pid)
  • Method Details

    • queryCommandlineEnvironment

      protected Pair<List<String>, Map<String,String>> queryCommandlineEnvironment()
      Description copied from class: AbstractProcOSProcess
      Reads this process's argument list and environment.
      Specified by:
      queryCommandlineEnvironment in class AbstractProcOSProcess
      Returns:
      a pair of (arg list, env map); either may be empty if it cannot be read
    • setState

      protected final void setState(OSProcess.State newState)
      Allows subclasses to set this process's state to OSProcess.State.INVALID when their perfstat lookup can't find the process. Mirrors the original pre-split AixOSProcess.updateAttributes() behavior so a stale perfstat_process_t[] array that briefly omits the pid leaves the OSProcess marked invalid rather than silently retaining whatever fields were last assigned.
      Parameters:
      newState - the new state
    • createThread

      protected OSThread createThread(int lwpid)
      Description copied from class: AbstractProcOSProcess
      Creates a platform-specific OSThread for the given lwpid of this process.
      Specified by:
      createThread in class AbstractProcOSProcess
      Parameters:
      lwpid - the thread (lwp) ID
      Returns:
      a new OSThread
    • getAffinityMask

      public long getAffinityMask()
      Description copied from interface: OSProcess
      Gets the process affinity mask for this process.

      On Windows systems with more than 64 processors, if the threads of the calling process are in a single processor group, returns the process affinity mask for that group (which may be zero if the specified process is running in a different group). If the calling process contains threads in multiple groups, returns zero.

      Because macOS does not export interfaces that identify processors or control thread placement, explicit thread to processor binding is not supported and this method will return a bitmask of all logical processors.

      If the Operating System fails to retrieve an affinity mask (e.g., the process has terminated), returns zero.

      Returns:
      a bit vector in which each bit represents the processors that a process is allowed to run on.
    • updateAttributes

      protected boolean updateAttributes(Quartet<Long,Long,Long,Long> cpuMem)
      Applies the perfstat-derived CPU and memory quartet to this process. Concrete subclasses arrange a Quartet&lt;ucpu_time(ms), scpu_time(ms), real_inuse(bytes), proc_real_mem_data+text(bytes)&gt; from their data source and call this. Returns true on success; sets state = INVALID and returns false otherwise.
      Parameters:
      cpuMem - the quartet of (userTime, kernelTime, residentSetSize, privateResidentMemory)
      Returns:
      true if attributes were updated
    • queryArgsEnv

      protected abstract Pair<List<String>, Map<String,String>> queryArgsEnv(int pid, AixPsInfo psinfo)
      Performs the address-space read for command-line arguments and environment variables.
      Parameters:
      pid - the process id
      psinfo - a populated AixPsInfo
      Returns:
      (argv list, env map) — may be empty if the address-space cannot be read
    • getCpuAffinityMask

      protected abstract long getCpuAffinityMask()
      Returns the per-process CPU affinity mask (from PerfstatCpu.queryCpuAffinityMask).
      Returns:
      affinity mask