Re: Raising Thread Priority
This is a multi-part message in MIME format.
------=_NextPart_000_010E_01C81180.F1706460
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
"jmarc" <jmarc@incursion-voyages.com> wrote in message =
news:mUKRi.11348$GO5.6235@edtnps90...
I would just to raise 'above normal'
my application (main thread).
I use the SetThreadPriority function
to raise it, but nothing change. Using
GetThreadPriority before and after
shown the priority level has not being
changed!
My app is working over 2 hours, just
digging alone in memory, and the CPU
is not really more than 30%. My app
is not creating and destructing lots of
object. Almost all memory is allocated
prior my app is transforming a medium
size database data into another one.
So, not much IOs are involved. Working
at higer level might split down significantly
the 2 hours time for that conversion...!
Any suggest on how to use the
SetThreadPriority function, or something
else might be better...?
Thanks
jamrc...
SetThreadPriority sets a priority relative to the application's priority =
class, which means a relative priority with respect to other threads =
within your process.
To get an absolute boost in priority you would need to call =
SetPriorityClass for your application.
But if your CPU is at 30% and nothing else is going on it indicates you =
are probably disk (or network) bound.
--
Scott McPhillips [VC++ MVP]
------=_NextPart_000_010E_01C81180.F1706460
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; =
charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16546" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>"jmarc" <<A
href="mailto:jmarc@incursion-voyages.com">jmarc@incursion-voyages.com</=
A>>
wrote in message <A
href="news:mUKRi.11348$GO5.6235@edtnps90">news:mUKRi.11348$GO5.6235@edt=
nps90</A>...</DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT face=Arial size=2>I would just to raise 'above =
normal'</FONT></DIV>
<DIV><FONT face=Arial size=2>my application (main =
thread).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I use the SetThreadPriority =
function</FONT></DIV>
<DIV><FONT face=Arial size=2>to raise it, but nothing =
change.
Using</FONT></DIV>
<DIV><FONT face=Arial size=2>GetThreadPriority before and =
after</FONT></DIV>
<DIV><FONT face=Arial size=2>shown the priority level has not
being</FONT></DIV>
<DIV><FONT face=Arial size=2>changed!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>My app is working over 2 hours, just
</FONT></DIV>
<DIV><FONT face=Arial size=2>digging alone in memory, and the =
CPU</FONT></DIV>
<DIV><FONT face=Arial size=2>is not really more than 30%. My =
app</FONT></DIV>
<DIV><FONT face=Arial size=2>is not creating and destructing lots
of</FONT></DIV>
<DIV><FONT face=Arial size=2>object. Almost all memory is
allocated</FONT></DIV>
<DIV><FONT face=Arial size=2>prior my app is transforming a
medium</FONT></DIV>
<DIV><FONT face=Arial size=2>size database </FONT><FONT =
face=Arial size=2>data
into another one.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>So, not much IOs are involved.
Working</FONT></DIV>
<DIV><FONT face=Arial size=2>at higer level might split down
significantly</FONT></DIV>
<DIV><FONT face=Arial size=2>the 2 hours time for that
conversion...!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Any suggest on how to use =
the</FONT></DIV>
<DIV><FONT face=Arial size=2>SetThreadPriority function, or
something</FONT></DIV>
<DIV><FONT face=Arial size=2>else might be better...?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>jamrc...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BLOCKQUOTE>
<DIV><FONT face=Arial size=2>SetThreadPriority sets a priority =
relative to the
application's priority class, which means a relative priority with =
respect to
other threads within your process. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>To get an absolute boost in priority =
you would need
to call SetPriorityClass for your application.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>But if your CPU is at 30% and nothing =
else is going
on it indicates you are probably disk (or network) =
bound.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>-- <BR>Scott McPhillips [VC++ MVP]</DIV></BODY></HTML>
------=_NextPart_000_010E_01C81180.F1706460--