The code in libpromises/processes_select.c and especially the code working with the static PROCESSTABLE is far from using best practices and best data structures we have. It uses the Item linked list which was created for other things so it uses wrong data types and names for things (e.g. PIDs are stored in the int counter field) and in general a linked list is not the best thing for such data. We should use a (sorted) sequence (Seq) or maybe a hash table (Map) depending on what is the most common way of accessing the data (lookup by PID, process name,...?).