php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54865 Child process inherits parent priority
Submitted: 2011-05-19 19:24 UTC Modified: 2016-10-16 02:19 UTC
From: matt at wootkit dot com Assigned: kalle (profile)
Status: Closed Package: Program Execution
PHP Version: 5.3.6 OS: Windows Server 2008 R2
Private report: No CVE-ID: None
 [2011-05-19 19:24 UTC] matt at wootkit dot com
Description:
------------
I'm running PHP in above-normal priority and would like to have child processes of it, spawned using proc_open, to inherit that priority level.

In Windows I believe this should just be a matter of running:
SetPriorityClass( GetCurrentProcess(), desired_priority );

I'm not sure if this is a bug report or a feature request though, I guess it depends on how you view it.

Test script:
---------------
$path = "c:\\windows\\system32\\notepad.exe";
$descriptorspec = array();
$cwd = "c:\\windows\\temp";
$env = NULL;
$other_options = array(
	'bypass_shell'	=> FALSE,
);

$resource = proc_open(
	$path,
	$descriptorspec,
	$pipes,
	$cwd,
	$env,
	$other_options
);

Expected result:
----------------
I expect the notepad.exe to have the abovenormal priority level, which is what the parent php script was running at.

Actual result:
--------------
notepad.exe runs at the normal priority level.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-16 02:19 UTC] kalle@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 [2016-10-16 02:19 UTC] kalle@php.net
Hi, I have implemented proc_nice() for Windows in 7.2, as it is too late for 7.1.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed May 12 22:01:23 2021 UTC