﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
152	StdoutRead maxes CPU on process (when not run from SciTe).	Saunders <admin@…>	Valik	"There appears to be a bug with StdoutRead that causes the spawned process to max out the CPU. I've provided two scripts, because this was the cleanest and simplest way I could discern to demonstrate the bug, I believe my code should work properly, although if there are errors with the code itself, feel free to ream me out for borking it.

Anyway, this first piece of code is the Child script, save it in a folder as TestChild.au3.
{{{
; Very simple script that should NOT max out the CPU
Do
	ConsoleWrite('Loop')
Until MsgBox(4, '', 'Continue?') = 7
}}}

This second piece of code is the Parent script, save it in the same folder as TestChild.au3.
{{{
#include <Constants.au3>

Global $sOutput, $sStdoutRead
Global $iScriptPID = Run(FileGetShortName(@AutoItExe) & ' ' & FileGetShortName(@ScriptDir & '\TestChild.au3'), @ScriptDir, @SW_HIDE, $STDOUT_CHILD)

While 1
	If $iScriptPID Then
		$sStdoutRead = StdoutRead($iScriptPID)
		If Not @error Then
			If @extended Then
				$sOutput &= $sStdoutRead & @LF
				ToolTip('Parent PID: ' & @AutoItPID & @LF & 'Child PID: ' & $iScriptPID & @LF & $sOutput)
			EndIf
		Else
			$iScriptPID = False
		EndIf
		Sleep(100)
	Else
		MsgBox(0, '', 'Parent exiting')
		ExitLoop
	EndIf
WEnd
}}}

Now, this is important, run the Parent script, but not through SciTe. I found that for whatever reason, running this code through SciTe doesn't give me any problems.

Now, while it's running have a look at your Task Manager, you should see that the child process is maxing out the CPU, and considering that it should be stopped on a MsgBox(), I really don't think it should be doing that."	Bug	closed	3.2.11.2	AutoIt	3.2.11.1		Fixed		
