PaulHigin / PSThreadJob

A PowerShell module for running concurrent jobs based on threads rather than processes
MIT License
180 stars 18 forks source link

Job host output is sent directly to parent host #5

Closed ajansveld closed 5 years ago

ajansveld commented 6 years ago

Running this gives unexpected output:

Start-ThreadJob {1..10 |% {[System.Console]::WriteLine("$_"); sleep 1}}

I would argue that console output should be discarded, just like Start-Job does.

ajansveld commented 6 years ago

BTW - I am happy to close this issue as it appears to be non-trivial to fix and the impact is minimal.

jazzdelightsme commented 6 years ago

Yeah, I would say this behavior is By Design--Start-ThreadJob gives PS runspace isolation, but it can't possibly attempt to provide process-like isolation for process-global things. And in fact, IMO it's part of the point (proc-global things can be shared without serialization).

ajansveld commented 5 years ago

Agreed, closing issue.