Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Question on Win32::Process

by kprasanna_79 (Hermit)
on Dec 29, 2005 at 07:12 UTC ( [id://519723]=perlquestion: print w/replies, xml ) Need Help??

kprasanna_79 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I am using Win32::Process, and i could see there are lot of option used in it. I couldn`t get enough pod from CPAN. Could any one explain me what these two options do in it.

NORMAL_PRIORITY_CLASS
CREATE_NO_WINDOW
Thanks in advance
-Prasanna.K

Replies are listed 'Best First'.
Re: Question on Win32::Process
by GrandFather (Saint) on Dec 29, 2005 at 07:38 UTC

    From MSDN Library:

    ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
    Process that has priority above NORMAL_PRIORITY_CLASS but below HIGH_PRIORITY_CLASS. Windows NT and Windows Me/98/95: This value is not supported.

    BELOW_NORMAL_PRIORITY_CLASS 0x00004000
    Process that has priority above IDLE_PRIORITY_CLASS but below NORMAL_PRIORITY_CLASS. Windows NT and Windows Me/98/95: This value is not supported.

    HIGH_PRIORITY_CLASS 0x00000080
    Process that performs time-critical tasks that must be executed immediately. The threads of the process preempt the threads of normal or idle priority class processes. An example is the Task List, which must respond quickly when called by the user, regardless of the load on the operating system. Use extreme care when using the high-priority class, because a high-priority class application can use nearly all available CPU time.

    IDLE_PRIORITY_CLASS 0x00000040
    Process whose threads run only when the system is idle. The threads of the process are preempted by the threads of any process running in a higher priority class. An example is a screen saver. The idle-priority class is inherited by child processes.

    NORMAL_PRIORITY_CLASS 0x00000020
    Process with no special scheduling needs.

    REALTIME_PRIORITY_CLASS 0x00000100
    Process that has the highest possible priority. The threads of the process preempt the threads of all other processes, including operating system processes performing important tasks. For example, a real-time process that executes for more than a very brief interval can cause disk caches not to flush or cause the mouse to be unresponsive.

    Every thread has a base priority level determined by the thread's priority value and the priority class of its process. The system uses the base priority level of all executable threads to determine which thread gets the next slice of CPU time. The SetThreadPriority function enables setting the base priority level of a thread relative to the priority class of its process.

    and for CREATE_NO_WINDOW

    The process is a console application that is run without a console window. This flag is valid only when starting a console application.

    DWIM is Perl's answer to Gödel
      The process is a console application that is run without a console window

      I think you may be confusing CREATE_NO_WINDOW with DETACHED_PROCESS.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        It is a direct quote from the "Process Creation Flags" documentation in the MSDN Library 2005


        DWIM is Perl's answer to Gödel
Re: Question on Win32::Process
by BrowserUk (Patriarch) on Dec 29, 2005 at 07:34 UTC

    NORMAL_PRIORITY_CLASS is exactly that. Use the normal priority for this process. Alternatives to are IDLE_, HIGH_ and REALTIME_PRIORITY_CLASS constants. These are the same values as you can set using the "set priority" submenu from the Task Manager context menu. On XP/2003 there are also ABOVE_NORMAL_PRIORITY and BELOW_NORMAL_PRIORITY, but these constants are not (yet) exported by Win32::Process.

    Simplistically, when a higher priority task becomes eligible to run, it will take precedence over lower priority processes. Be aware that changing these values to other than NORMAL is inadvisable unless you have good reasons, and the process is written to operate properly at the chosen level.

    For the full nitty gritty, see the MSDN explanations.

    According to this documentation, the CREATE_NO_WINDOW flag is ignored!


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Thanks for the wonderful answer browseruk
      But do you have any idea what for this CREATE_NO_WINDOW was introduced in Win32::Process or what it actually doing in it. Because i am more curious to know that.Please
      -Prasanna.K

        Guessing, I would say that the CREATE_NO_WINDOW constant was added to the Win32 header files for some envisaged use that never got added, or was rejected for some reason.

        The reason it is exported by Win32::Process is because it was discussed and documented in the MS documentation for the call, and because it might do something useful at some point in the future. As it stands, it will just do nothing.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Question on Win32::Process
by planetscape (Chancellor) on Dec 29, 2005 at 09:07 UTC

    I hope this does not sound snide, as that is certainly not my intention... But if you have Win32::Process installed, could you use perldoc Win32::Process to view the POD, or pod2html to generate HTML docs?

    HTH,

    planetscape

      Not so much snide as optimistic. The docs just list a bunch of constants and a few methods.


      DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://519723]
Approved by prasadbabu
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2024-03-28 17:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found