Topic: Request: ShellExecute - Process Priority  (Read 402 times)

0 Members and 1 Guest are viewing this topic.

Request: ShellExecute - Process Priority
« on: December 14, 2017, 01:34:58 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7756
Hi ied206,

Can we have Priority feature with Shellexecute
Code: [Select]
'ShellExecute,Hide,ExeFile,"Parameters"',"StartInPath"
->
Code: [Select]
'ShellExecute,Hide,ExeFile,"Parameters"',"StartInPath","Priority"

Priority:
RealTime
High
AboveNormal
Normal

BelowNormal
Low

ps:
Currently on projects,
mostly /BelowNormal used on some plugins (CreateISO and Cache) to avoid "HostOS slow down" for end users

It will be easier with PEBakery supporting this feature.

:turtle:
« Last Edit: December 15, 2017, 02:14:33 AM by Lancelot »

Re: Request: ShellExecute - Process Priority
« Reply #1 on: December 14, 2017, 11:18:42 AM »

Homes32

  • Code Baker
  • Chef
  • ***
  • Date Registered: Dec 2010
  • Posts: 147
IMHO I don't believe this would be a good idea. unless your still running Windows 9x its unlikely a script/plugin author knows better then the OS process scheduler what is the best use of resources. couple this with the possibility for ignorant users seeing the option and deciding they need to run their process in real-time priority, because hey! it should be the fastest right!?!?!

and again unless your on a really old system < P4, CPU resources when building generally isn't going to be an issue unless you routinely edit/render/encode video, are into heavy graphic design rendering, or feel the need to run prime95 wide open on all your cores while you are building your PE. If your running into slowness then its more likely related to paging/RAM/slow hard-drive/etc and adjusting the processes CPU priority isn't going to help you there.
« Last Edit: December 14, 2017, 11:31:35 AM by Homes32 »

Re: Request: ShellExecute - Process Priority
« Reply #2 on: December 14, 2017, 11:33:38 AM »

JFX

  • Code Baker
  • Sr. Chef
  • ****
  • Date Registered: Dec 2010
  • Posts: 924
If there is any sense to process priority,
than it should start any child process with the same priority PEBackery.exe is running.
So the end user has total control over it.

Re: Request: ShellExecute - Process Priority
« Reply #3 on: December 14, 2017, 11:23:59 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 203
I don't think priority would be necessary, because of these reasons:

1. Most of systems exist in 2017 has multicore CPU.
PEBakery's interpreter engine operates in single thread since WB lang was never designed to work with multithread.
Windows is capable of scheduling process to make sure all cores are working simultaneously, so a subprocess spawned by PEBakery will run in different core.
Intel and AMD do not produce single core system for consumers and they did this at least for 10 years, so I don't think I have to consider single core system.

2. Can be abused to use high priority
If a developer do not have proper knowledge about scheduling, he/she can abuse RealTime setting, causing system uncontrollable.
Even me made this mistake 10 years ago, I was not able to kill a process with RealTime priority in Netburst-based Celeron system.
« Last Edit: December 14, 2017, 11:25:59 PM by ied206, Reason: typo »

Re: Request: ShellExecute - Process Priority
« Reply #4 on: December 15, 2017, 02:13:55 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7756
Than:

BelowNormal
Low

is good enough. (and we avoid end user mistake with RealTime .. )

->
BelowNormal so far good solution to avoid "HostOS slow down" for end users.

-->
With BelowNormal and ShellExecute,Min ( http://theoven.org/index.php?topic=2317 )
We can replace relevant lines with Macro Library to native PEBakery ShellExecute.

:turtle:

Re: Request: ShellExecute - Process Priority
« Reply #5 on: December 16, 2017, 02:27:36 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 203
Currently ShellExecute can have up to three optional parameters.

Code: [Select]
ShellExecute,<Action>,<FilePath>,[Params],[WorkDir],[%ExitOutVar%]
ShellExecuteEx,<Action>,<FilePath>,[Params],[WorkDir]
ShellExecuteDelete,<Action>,<FilePath>,[Params],[WorkDir],[%ExitOutVar%]

If we are to implement this, adding more optional parameter can make syntax confusing. Better to make a new variant.
Code: [Select]
Ex) ShellExecuteLowPriority,<Action>,<FilePath>,[Params],[WorkDir],[%ExitOutVar%]
« Last Edit: December 16, 2017, 02:44:01 PM by ied206 »

Re: Request: ShellExecute - Process Priority
« Reply #6 on: December 16, 2017, 03:48:50 PM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7756
If we are to implement this, adding more optional parameter can make syntax confusing. Better to make a new variant.
Code: [Select]
Ex) ShellExecuteLowPriority,<Action>,<FilePath>,[Params],[WorkDir],[%ExitOutVar%]

ShellExecuteBelowNormal,

sounds better, since it is also named same with ms.
https://technet.microsoft.com/en-us/library/bb491005.aspx

it will be easily understood by users.

:turtle:

Re: Request: ShellExecute - Process Priority
« Reply #7 on: December 17, 2017, 10:25:55 AM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 203
I decided to implement restrited shellexecute, allowing only BelowNormal prioirty.
Please give me some time to think about names...
« Last Edit: December 17, 2017, 10:51:46 AM by ied206 »

Re: Request: ShellExecute - Process Priority
« Reply #8 on: December 20, 2017, 01:46:14 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 203
New command ShellExecuteSlow introduced in commit 8d4b611, same usage with ShellExecute command.

Will be included in next release.

 

Powered by EzPortal