Overview
Features
Download
Documentation
Community
Add-Ons & Services

various enhancement requests for Process

A general discussion forum.

various enhancement requests for Process

Postby marlowabnp » 14 Dec 2010, 16:52

I am looking at the Poco Process class for launching programs and I have a few enhancement requests.

I would like to be able to specify an initial working directory

I want to be able to set the priority of the process when it is first created.

I want to be able to specify a collection of environment variables (name/value pairs).

I realise that these are very windoze-y things to ask for. All these things are parameters to the WIN32 API routine that creates a process. But the app I am working on has windoze as the primary platform. The code that launches apps is windoze-centric because it needs to be able to do all these things. But I want to make it platform-independent. I reckon it can be done. My requirements do have corresponding ways of being done on posix. For example, environment variable can be set using putenv, the current directory of a child process can be set using chdir. The priority of a running process can also be changed using setpriority. Is there any chance the Poco Process class can be extended to cover these areas please?

Regards,

Andrew Marlow
marlowabnp
 
Posts: 89
Joined: 08 Nov 2010, 17:29

Re: various enhancement requests for Process

Postby marlowabnp » 14 Dec 2010, 18:30

I have been thinking about the priority part of my enhancement request. This is a little bit tricky. The different priority levels available in the WIN32 CreateProcess are described at http://msdn.microsoft.com/en-us/library ... 85%29.aspx. These are *extremely* OS-specific. There is no direct correspondence between these and POSIX nice levels.

Perhaps what is needed is some new Foundation class (ProcessPriority???) which is the lowest common denominator. It would provide levels that allow the WIN32 priorities to be mapped to and provide the next best thing using POSIX nice levels. Thoughts, anyone?

-Andrew Marlow
marlowabnp
 
Posts: 89
Joined: 08 Nov 2010, 17:29

Re: various enhancement requests for Process

Postby marlowabnp » 16 Dec 2010, 11:59

Thinking about the priority business some more I have taken a different approach. I had added priority to the launch method as a string. For Windoze the string is the string form of the enum (e.g "NORMAL_PRIORITY_CLASS", "IDLE_PRIORITY_CLASS" etc). For UNIX it will be the string form of the integer nice number (e.g "10", "4" etc). I reckon this is the easiest pseudo-platform-independent way to pass a priority which is inhertently OS-specific.

-Andrew M.
marlowabnp
 
Posts: 89
Joined: 08 Nov 2010, 17:29

Re: various enhancement requests for Process

Postby marlowabnp » 22 Mar 2011, 18:46

I would really appreciate some feedback from Poco developers please. These enhancement are really quite useful when in a Windoze environment.

-Andrew Marlow
marlowabnp
 
Posts: 89
Joined: 08 Nov 2010, 17:29

Re: various enhancement requests for Process

Postby guenter » 22 Mar 2011, 18:54

The proposed enchancements certainly make sense. Some code contributions would be welcome, otherwise this would have to wait until I have some more time available (which certainly will not be before summer).
guenter
 
Posts: 1135
Joined: 11 Jul 2006, 16:27
Location: Austria


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron