Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > CPU usage program

Reply
Thread Tools

CPU usage program

 
 
sethukr@gmail.com
Guest
Posts: n/a
 
      10-08-2007
Hi everybody,

Can anyone give me a simple program which would consumes more CPU
usage (more than 50%) in windows?

Thanks,
Sethu

 
Reply With Quote
 
 
 
 
santosh
Guest
Posts: n/a
 
      10-08-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> Hi everybody,
>
> Can anyone give me a simple program which would consumes more CPU
> usage (more than 50%) in windows?


int main(void)
{
volatile unsigned long i = 0;
for (; i++;
return 0;
}

 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      10-08-2007
In article <fedhm3$66h$(E-Mail Removed)>, santosh <(E-Mail Removed)> wrote:
>(E-Mail Removed) wrote:


>> Can anyone give me a simple program which would consumes more CPU
>> usage (more than 50%) in windows?


>int main(void)
>{
> volatile unsigned long i = 0;
> for (; i++;
> return 0;
>}


I'm wondering if the original poster has a dual-core or hyperthreaded
system, and thus needs a threaded or multi-process program in order
to "consume" more than 50% of the CPU usage on their system.

--
We regret to announce that sub-millibarn resolution bio-hyperdimensional
plasmatic space polyimaging has been delayed until the release
of Windows Vista SP2.
 
Reply With Quote
 
Tor Rustad
Guest
Posts: n/a
 
      10-08-2007
(E-Mail Removed) wrote:
> Hi everybody,
>
> Can anyone give me a simple program which would consumes more CPU
> usage (more than 50%) in windows?



The OS will try to stop such an application for consuming CPU cycles, so
either you need to write a *rootkit*, or fool the OS billing system.


Both methods, require *off-topic* code, which can be used by any
*clueless* script kid, to attack computer systems.


The <(E-Mail Removed)> account, may already be tracked by US
authorities, so I suggest you go under ground... before getting into
trouble.


--
Tor <torust [at] online [dot] no>
 
Reply With Quote
 
Flash Gordon
Guest
Posts: n/a
 
      10-08-2007
Walter Roberson wrote, On 08/10/07 16:26:
> In article <fedhm3$66h$(E-Mail Removed)>, santosh <(E-Mail Removed)> wrote:
>> (E-Mail Removed) wrote:

>
>>> Can anyone give me a simple program which would consumes more CPU
>>> usage (more than 50%) in windows?

>
>> int main(void)
>> {
>> volatile unsigned long i = 0;
>> for (; i++;
>> return 0;
>> }

>
> I'm wondering if the original poster has a dual-core or hyperthreaded
> system, and thus needs a threaded or multi-process program in order
> to "consume" more than 50% of the CPU usage on their system.


#include <stdlib.h>
int main(void)
{
for (; system("cpukiller");
}

Build the above and install the executable so that it can be invoked
successfully executed as cpukiller using the system function. That is
likely able to hit as many CPUs as you have.
--
Flash Gordon
 
Reply With Quote
 
Richard Tobin
Guest
Posts: n/a
 
      10-08-2007
In article <(E-Mail Removed) om>,
(E-Mail Removed) <(E-Mail Removed)> wrote:

>Can anyone give me a simple program which would consumes more CPU
>usage (more than 50%) in windows?


Either have fewer than two CPUs (increasingly tricky these days), or
write a multi-threaded program.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      10-08-2007
Tor Rustad <(E-Mail Removed)> writes:
> (E-Mail Removed) wrote:
>> Can anyone give me a simple program which would consumes more CPU
>> usage (more than 50%) in windows?

>
> The OS will try to stop such an application for consuming CPU cycles,
> so either you need to write a *rootkit*, or fool the OS billing system.

[...]

<OT>
Windows prevents any process from consuming more than 50% of the CPU?
Really? How do I enable this?
</OT>

--
Keith Thompson (The_Other_Keith) (E-Mail Removed) <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      10-08-2007
Keith Thompson said:

<snip>

> Windows prevents any process from consuming more than 50% of the CPU?


Yes. It achieves this by using 51% of the CPU itself.

<g,d&r>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
 
Reply With Quote
 
Eric Sosman
Guest
Posts: n/a
 
      10-08-2007
Keith Thompson wrote On 10/08/07 16:33,:
> Tor Rustad <(E-Mail Removed)> writes:
>
>>(E-Mail Removed) wrote:
>>
>>>Can anyone give me a simple program which would consumes more CPU
>>>usage (more than 50%) in windows?

>>
>>The OS will try to stop such an application for consuming CPU cycles,
>>so either you need to write a *rootkit*, or fool the OS billing system.

>
> [...]
>
> <OT>
> Windows prevents any process from consuming more than 50% of the CPU?
> Really? How do I enable this?
> </OT>


<OT>

Press the Windows "flag" key, press U, press U again.
(YMMV on non-English installations.)

</OT>

--
(E-Mail Removed)
 
Reply With Quote
 
Martien Verbruggen
Guest
Posts: n/a
 
      10-08-2007
On 8 Oct 2007 20:24:04 GMT,
Richard Tobin <(E-Mail Removed)> wrote:
> In article <(E-Mail Removed) om>,
> (E-Mail Removed) <(E-Mail Removed)> wrote:
>
>>Can anyone give me a simple program which would consumes more CPU
>>usage (more than 50%) in windows?

>
> Either have fewer than two CPUs (increasingly tricky these days), or
> write a multi-threaded program.


Or run more than one copy of the same program.

Martien
--
|
Martien Verbruggen | Freudian slip: when you say one thing but
| mean your mother.
|
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control CPU usage of a program? Davy C Programming 6 11-04-2012 02:46 AM
CPU usage program Sethu C++ 11 10-09-2007 08:36 AM
retrieving CPU Usage and Memory Usage information in JAVA hvt Java 0 03-13-2007 01:09 PM
retrieving CPU Usage and Memory Usage information in JAVA hvt Java 0 03-13-2007 01:07 PM
Control CPU usage of a program? Robert C++ 3 08-21-2005 07:15 PM



Advertisments