Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there something like 'Idle Sensitivity'? #840

Closed
daFritz84 opened this issue Dec 18, 2020 · 7 comments · Fixed by #842
Closed

Is there something like 'Idle Sensitivity'? #840

daFritz84 opened this issue Dec 18, 2020 · 7 comments · Fixed by #842

Comments

@daFritz84
Copy link

Hi all,

I run a win16 license server application which constantly polls for connections and completely saturates one cpu core. NTVDM had some feature called 'Idle Sensitivity' which somehow limited application polling for events. Is there some similar setting in winevdm, or are there other means to limit cpu usage?

Here is some screenshot of the 'Idle Sensitivity' slider I'm looking for:
image

@cracyc
Copy link
Contributor

cracyc commented Dec 18, 2020

A configurable forced sleep in Peekmessage might work but I'd need to see a trace to be sure.

@daFritz84
Copy link
Author

I'm already at home now. But I will try to get a trace recorded next week.

Anyways, the "high cpu load - polling for events" is just a hypothesis. But I have other applications, i.e. the accompanying client, which behaves completely normal with winevdm. It's just the license server which is eating up cpu power.

@daFritz84
Copy link
Author

I got a trace: trace.txt

It seems like it does loop around PEEKMESSAGE. The following calls are repeated continously:

0df8:Call USER.109: PEEKMESSAGE(124f:8612,0000,0000,0000,0001) ret=14a7:3e25 ds=164f
0df8:Ret  USER.109: PEEKMESSAGE() retval=00000000 ret=14a7:3e25 ds=164f
0df8:Call WINSOCK.1: ACCEPT(038c,124f:8578,124f:85a2) ret=16ef:4db0 ds=1777
0df8:Ret  WINSOCK.1: ACCEPT() retval=ffffffff ret=16ef:4db0 ds=1777
0df8:Call WINSOCK.111: WSAGETLASTERROR() ret=16ef:4dbc ds=1777
0df8:Ret  WINSOCK.111: WSAGETLASTERROR() retval=00002733 ret=16ef:4dbc ds=1777

@cracyc
Copy link
Contributor

cracyc commented Dec 20, 2020

Give https://ci.appveyor.com/project/otya128/winevdm/builds/36925455/job/m7gfvv4og5fyti7d/artifacts a try. Set the sleep length in the otvdm.ini file.

@daFritz84
Copy link
Author

Thank you so much! Works like a charm.
May I ask what unit of measurement PeekMessageSleep has? I assume ms?

@cracyc
Copy link
Contributor

cracyc commented Dec 20, 2020

Yes, milliseconds. It uses MsgWaitForMultipleObjects (https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-msgwaitformultipleobjects).

@daFritz84
Copy link
Author

Thanks again for the prompt implementation. I will close the issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants