Solved

NT Service priority

Posted on 2000-04-05
5
257 Views
Last Modified: 2013-12-03
My question is basically simple - do programs running as services under Windows NT 4 run at a higher priority than programs running normally?

We have a program that sits in the background, looping around, checking some values in a database every second or so. Sometimes it needs to run as a service, sometimes as a normal program. So we have a module for each, with the appropriate code in the service module to register it and so forth - but the REAL code is all identical. The problem is, when we run the normal program, it takes about 10% CPU - fine, about what we expected. But the service, when started, settles on around 80% CPU - yet they're both executing the same code. We're pretty lost - any suggestions?
0
Comment
Question by:tofff
5 Comments
 
LVL 15

Expert Comment

by:NickRepin
ID: 2686637
Call GetPriorityClass and GetThreadPriority in both cases to be sure about the priorities.
0
 
LVL 15

Expert Comment

by:NickRepin
ID: 2686640
Also GetThreadPriorityBoost.
0
 

Author Comment

by:tofff
ID: 2686704
Thanks, but I don't WANT to boost any thread's priority...I want the service thread to run at the same priority/CPU usage as the normal program. Through third-party applications, it SEEMS as though both threads when they run have teh same priority...but I'm not sure.
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 2686915
>>do programs running as services under Windows NT 4 run at
>>a higher priority than programs running normally?

The answer to this very question is: No, they don't - you can easily check this by viewing the process' (base) priority using the task manager.

However, a service faces some other ramifications that a 'normal' program doesn't, e.g. SCM control requests (wich all require calling 'SetServiceStatus()'), security checks and so on.

A more specific answer to the problem that you're facing requires some more information about what the service/program actually does, so feel free to ask!
0
 
LVL 2

Expert Comment

by:DKostov
ID: 2687820
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Vb.Net Loading Word 11 103
MSDN Subscription - Azure and NFP's 3 71
What is UAC Virtualization in the Process (TASK) Manager? 4 2,078
Alternative to visual sourcesafe 2 124
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question