2011 links no. 3

Interview With Sacha Barber in The Code Project. The ABA problem occurs during synchronization, when a location is read twice, has the same value for both reads, and “value is the same” is used to indicate “nothing has changed”. However, another thread can execute between the two reads and change the value, do other work, …

Microsoft’s PowerShell hangs when output is captured using Windows API

I was debugging a program that uses Windows API (Creating a Child Process with Redirected Input and Output) to capture stdout of Microsoft’s Windows PowerShell. Script passed to PowerShell (-File switch) didn’t execute and PowerShell just hanged until killed by Task Manager. It turns out that you need to use undocumented parameter “-InputFormat none”: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe …