Request: Expose parent process ID on the Process class

Aperta
#137,203 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp

Direzione di ricerca

The work centres on the Parent property of System.Diagnostics.Process, which the issue says is slow and returns an object already present in GetProcesses. Start by reading how Parent is resolved in the Process implementation for each OS. The request is for a ParentId or ParentProcessId property, so this needs an API proposal and review before any code. Done means an approved API, implementations on each platform, and tests that check the parent id against Parent.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area-System.Diagnostics.Process untriaged

Currently the System.Diagnostics.Process exposes a Parent property which returns the parent process class.
When building a processes tree, we can get all processes (GetProcesses) but the performances of the Parent property are catastrophic and returning an object that is already in the list of processes.
Exposing a ParentId or ParentProcessId would simplify and speed up this process.

Workaround

Under Windows getting the WMI_Process solves the problem, but it is a Windows-only solution.

Usecase

I am creating a usage summary per capability where processes are identified to belonging to a certain group.
Once a process is identified, all its children are part of its capability, so of its summary.

Lingua principale
C#
Stelle
18.4k
Fork
5.8k
Merge medio
2g 19h
PR unite (30g)
590

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dotnet/runtime

Tutte le issue di dotnet/runtime

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.