flat assembler
Message board for the users of flat assembler.

Index > Windows > Simple example showing run at 100% on all cores?

Author
Thread Post new topic Reply to topic
ohara



Joined: 13 Oct 2006
Posts: 20
ohara 17 Jul 2023, 07:57
Is there a simple windows example program that demonstrates running a distributed task at 100% on all 8 cores? I have often seen software do this....
Post 17 Jul 2023, 07:57
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1671
Location: Toronto, Canada
AsmGuru62 17 Jul 2023, 11:25
Windows as an operating system also has to run on the same cores, so I am not sure you can get a 100% on ALL.
There is a Windows API function SetThreadAffinityMask which allows a thread (one of eight in your case) to run on a specific core.
So, basically, you can create 7 threads in addition to one main thread and then assign the core to each thread.
Then run the same CPU heavy loop on every thread.
But Windows is the one deciding the scheduling, so your code will run, but I doubt the 100% value here.
Windows run sometimes dozens of services and they all will run at the same time as your code.
Post 17 Jul 2023, 11:25
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 17 Jul 2023, 11:34
An average of100% isn't achievable over long time scales. But instantaneous 100% is easily achievable on short timescales between timer ticks when the OS has scheduled threads in your app to run on all the cores.
Post 17 Jul 2023, 11:34
View user's profile Send private message Visit poster's website Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 350
Location: Poland
macgub 21 Jul 2023, 12:10
Former version of FractalExplorer by tthsqe - has 100% load whole app run time on win7. I will digg my drives ...
This from https://flatassembler.net/examples.php dont have this feature....
Post 21 Jul 2023, 12:10
View user's profile Send private message Visit poster's website Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 350
Location: Poland
macgub 21 Jul 2023, 12:23
Check attachment... If I broke someone laws, when I release former FractalExplorer app - let me know...


Last edited by macgub on 31 Aug 2023, 12:07; edited 1 time in total
Post 21 Jul 2023, 12:23
View user's profile Send private message Visit poster's website Reply with quote
Feryno



Joined: 23 Mar 2005
Posts: 514
Location: Czech republic, Slovak republic
Feryno 28 Jul 2023, 17:13
If you are able to create a driver, you can call KeIpiGenericCall which runs at IRQL=0Ch=IPI_LEVEL. It is used e.g. for synchronizing MTRRs at all CPUs/cores so highly prioritized task. Ring3 tasks run at IRQL=0 which is the lowest priority and any task with higher priority can interrupt them.
Post 28 Jul 2023, 17:13
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
ohara



Joined: 13 Oct 2006
Posts: 20
ohara 30 Aug 2023, 21:27
Thanks for this, and to the writers of the mandelbrot example.... I've got this going on all 16 cores at 100%, in fact with the fans making so much noise I'm afraid my laptop will catch fire.....
Post 30 Aug 2023, 21:27
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 31 Aug 2023, 01:30
Hi. I think this example is due for an update. I made some mistakes, and 512 bit vectors are out now. No need to waste space here - it is always on the examples page https://flatassembler.net/examples.php
Post 31 Aug 2023, 01:30
View user's profile Send private message Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 350
Location: Poland
macgub 31 Aug 2023, 12:18
tthsqe wrote:
No need to waste space here....

ok - I remove attachment...
I just think this feeling 100% cpu power has its value.. Some thrill in body...

Especially you know CPU is busy on task different than standard secret inside Windows jobs...
Post 31 Aug 2023, 12:18
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.