How can I be sure that a process does not go to sleep?

Page 2 of 3 FirstFirst 123 LastLast
  1. Try3's Avatar
    Posts : 10,009
    Windows 10 Home x64 Version 21H2 Build 19044.1466
       #11

    regressist said:
    ...otherwise I have to find a blackpicture and set it as a screensaver ...
    Windows 10 includes a screensaver called "Blank" and that's what I selected.

    If you cannot find the screensaver dialog through the menu system, you can just run this command.
    Code:
    C:\Windows\System32\rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1


    Denis
      My Computer

  2. selden's Avatar
    Posts : 145
    Win10 Pro X64 21H2 build 19044.1415
       #12

    regressist said:
    I had already put very high and was around 34%, like now
    That percentage of use is consistent with a single-threaded program running on a CPU which has 4 cores and 8 threads.
    (I just now verified this by writing a trivial Fortran program which increments a variable and types out its value periodically on my laptop which has an I7 CPU with 4 cores and 8 threads. I used gfortran under Cygwin.)

    How many cores are in your CPU? How many logical processors does it have?
    This information is available on TaskManager's CPU usage page.

    Is the program that you're running multi-threaded or single-threaded?

    If you're running a program which is not intentionally written to use more than one logical processor (i.e. if it is not explicitly written to be multi-threaded), then it will only be able to use a single logical processor. As a result, if your computer has more than one logical processor, such a single-threaded program only be able to use a small percentage of the total CPU cycles available.

    I believe that TaskManager reports more than 12% (which would correspond to one logical processor out of 8 being fully saturated by a single thread) in my case is because the Fortran I/O system is itself multi-threaded, initiating the program's terminal I/O and returning to the main program before that I/O has completed.
      My Computer


  3. Posts : 16
    windows 10 home
    Thread Starter
       #13

    selden said:
    That percentage of use is consistent with a single-threaded program running on a CPU which has 4 cores and 8 threads.
    (I just now verified this by writing a trivial Fortran program which increments a variable and types out its value periodically on my laptop which has an I7 CPU with 4 cores and 8 threads. I used gfortran under Cygwin.)

    How many cores are in your CPU? How many logical processors does it have?
    This information is available on TaskManager's CPU usage page.
    Hi and thanks for the reply, there are 2 cores and 4 logical processors. The specification of the computer are

    Processor Intel Core i3-11xxx Name Processor 1115G4 3.0 GHz (6M Cache, up to 4.1 GHz, 2 cores), speed in GHz 4,1

    The program is for sure single threaded, I wrote it in old fashioned Pascal

    - - - Updated - - -

    Try3 said:
    Windows 10 includes a screensaver called "Blank" and that's what I selected.

    If you cannot find the screensaver dialog through the menu system, you can just run this command.
    Code:
    C:\Windows\System32\rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1


    Denis
    Thanks it's useful since the blank is not available in the menu
      My Computer

  4. Try3's Avatar
    Posts : 10,009
    Windows 10 Home x64 Version 21H2 Build 19044.1466
       #14

    If you cannot find the screensaver dialog through the menu system, you can just run this command.
    This was intended to mean
    If you cannot find the screensaver dialog through the menu system, you can just run this command to get to the screensaver dialog where you will be able to select the blank screensaver from the dropdown list.

    Denis.
    Last edited by Try3; 01 Dec 2021 at 11:28.
      My Computer

  5. steve108's Avatar
    Posts : 18,669
    19041.1466 - 2004/20H1 Pro x64
       #15

    @Try3, Did you forget to include the command in the last post?
      My Computer

  6. Try3's Avatar
    Posts : 10,009
    Windows 10 Home x64 Version 21H2 Build 19044.1466
       #16

    steve108 said:
    @Try3, Did you forget to include the command in the last post?
    No, I was trying to counter what I worried about being a misinterpretation of my previous post.

    All he best,
    Denis
      My Computer


  7. Posts : 140
    Windows 10
       #17

    regressist said:
    Thanks Denis, I thought there was a possibility to wakelock the process, but this should be ok anyway.
    Well, lots of applications do power requests to prevent the computer from going to sleep while they're running (and I get to do a lot of POWERCFG /REQUESTSOVERRIDE). So if you're a good programmer, you can make your program do the same thing.

    Try calling the Windows function SetThreadExecutionState.

    https://docs.microsoft.com/en-us/win...executionstate
      My Computer

  8. Try3's Avatar
    Posts : 10,009
    Windows 10 Home x64 Version 21H2 Build 19044.1466
       #18

    Eksy61 said:
    Well, lots of applications do power requests to prevent the computer from going to sleep while they're running (and I get to do a lot of POWERCFG /REQUESTSOVERRIDE). So if you're a good programmer, you can make your program do the same thing.
    Try calling the Windows function SetThreadExecutionState.
    https://docs.microsoft.com/en-us/win...executionstate
    That is not the problem the OP has.
    The OP's computer does not have Sleep. It has S0 Modern standby which uses different mechanisms to achieve its ends.

    Denis
      My Computer


  9. Posts : 16
    windows 10 home
    Thread Starter
       #19

    Try3 said:
    That is not the problem the OP has.
    The OP's computer does not have Sleep. It has S0 Modern standby which uses different mechanisms to achieve its ends.

    Denis
    Thanks for your support Denis. I confirm that now with just Never Suspend setting the pc works always, no need of a black screensaver.

    In view of the hw of this pc ((Processor Intel Core i3-11xxx Name Processor 1115G4 3.0 GHz (6M Cache, up to 4.1 GHz, 2 cores), speed in GHz 4,1)), do you think I could launch one more dos window (or maybe even two) and run other instances of the same program without slowing the first one (but maybe burnig the processor, now the fan is going extremely low and silent) ?
      My Computer

  10. selden's Avatar
    Posts : 145
    Win10 Pro X64 21H2 build 19044.1415
       #20

    Since you have 4 threads available (2 per core), running a second instance of your program shouldn't impact interactive response too much. Thermals might be a problem, but you should try doing it to find out for sure. You won't damage the computer. Modern CPUs automatically throttle their clock rate to prevent overheating, so you might check for that. (Clock rate is shown in the Task Manager's CPU display.)

    Don't forget to make sure that the separate copies of your program write their results to separate files.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 21:25.
Find Us




Windows 10 Forums