Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / CAN'T DBP BE MORE EFFICIENT IN THE USE OF THE CPU...

Author
Message
Terabyte
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 25th Feb 2003 15:49
CAN'T DBP BE MORE EFFICIENT IN THE USE OF THE CPU BECAUSE AT THE MOMENT I'M TRYING TO MAKE A WINDOWS BASED APPLICATION AND IT'S CONSTANTLY USING 100% OF THE CPU.
NON OF THE OTHER WNDOWS APPLICATIONS DO THIS
I MEAN, I CAN UNDERSTAND IF I WAS USING A LOT OF 3D GRAPHICS BUT I AM NOT. I AM JUST USING BOXES ON THE SCREEN.
ANY ANSWERS
I have a word of advice...
..don't piss on an electric fence!
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 25th Feb 2003 15:55
Kill the all-caps please.

And most DirectX programs will use 100% CPU time. You are right, Windows apps might not - but try out a game or something more akin to what DB creates.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th Feb 2003 16:06
Look carefully at you're CPU resources in the Task Manager, as they're not correct ... DirectX simply uses all available FREE% of the CPU

if you run other programs suchas Milkshape, notice how it works fine - cause the computer takes back what processing power it feels like. It's all automatically allocated by Windows i'm afriad - most programs get Priority when active.

However i'd prefer if Pro utilised the Extensions - because i have a feeling it only uses MMX acceleration because DirectX has that as standard

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 25th Feb 2003 16:40
stop bloody using the all caps.

xxxpetratxxx
B. R. W
darkCorridor
22
Years of Service
User Offline
Joined: 27th Jan 2003
Location:
Posted: 25th Feb 2003 17:33
grr... caps i even hate caps after a full stop... but all caps?!

[br]mikey
OrcishBlue
22
Years of Service
User Offline
Joined: 9th Feb 2003
Location: Canada
Posted: 25th Feb 2003 18:18
are those other windows applications programmed in DBPRO ? no !
Games dev = DirectX / DBPro <-- designed to use all possible system resource, ie better framerates/preformance.

Different tools for different tasks, you're trying to fix a leaking pipe with a hammer, use the correct tools !

and please, KILL THE CAPS !!!! you're just asking for it if you keep it up.
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th Feb 2003 18:27
no Orcish you don't understand... he's using the Tap - and wondering why the water is all being used up

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Viktor
22
Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 25th Feb 2003 21:35
There is a problem with DBP Windowed mode and other applications. If a Windowed DBP program is running (Win2K), and I bring WordPad to the front to view a output file, the mouse cursor freezes for a few seconds and then it is released for a fraction of a second and then it freezes again... It is not very funny and happens with some other programs too.

P.S. The others ´re right: kill da f*****g caps, or is your keyboard defect, Frobscottle?

PC: AMD 1200/512 Mb SDR/GF2MX Dual Display/Win2000, 19" Monitor
ZX: Spectrum 128+ Customized version.
Current Project: BMP2SCR Pro (with LDIR)
rapscaLLion
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 25th Feb 2003 23:13
Ya, my system is fine running DB apps, however if I switch out of the DB app it takes 5 minutes to close the damn thing.

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 26th Feb 2003 03:03
thats a bug with the DarkBasic Pro Application itself Raps, but it has some basis as WindowsXP tends not to release or allocate memory immediatly - it waits for the next available second, which is annoynig at times.

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 26th Feb 2003 09:46
"There is a problem with DBP Windowed mode and other applications. If a Windowed DBP program is running (Win2K), and I bring WordPad to the front to view a output file, the mouse cursor freezes for a few seconds and then it is released for a fraction of a second and then it freezes again..."

Your CPU is struggling to do both things at once. The DBP app is taking up 100% CPU time (or trying to anyway) and you're then going and loading WordPad - no small wonder it's running slowley.

Either change your code so that when DBP loses focus you send it to sleep or stop expecting it to behave like this - not many games do! Try running WordPad and Unreal2 at the same time for instance.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
rapscaLLion
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 26th Feb 2003 14:46
well, half-life is fine when I switch out and do other stuff, ie- make changes to the map I'm running in WorldCraft.
Course, that's about all I've tested

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 26th Feb 2003 15:11
I meant running at the same time - not switched out of (because you can code that into your DBPro games too).

Even half-life and wordpad would have an interesting effect on CPU time together.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 26th Feb 2003 16:13
i tend not to use Half-Life in window or even minimised... does funky things (bloody bugs)

i oftenly run Jedi Knight2, GTKRadient 1.2.12, MSVC++, DarkBasic Pro, DarkBasic Pro EXE, mIRC, Media Player and DarkEdit ... only the DarkBasic Pro EXE will slowdown
they don't really get a great ammount of priority for the CPU

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
rapscaLLion
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 26th Feb 2003 23:45
lol I don't use half-life in a window either, but I am running photoshop for textures, worldcraft for the world and testing that same world in half-life at the same time, and I have got a pretty crappy computer

But I really don't mind, it's not so much DB's fault right?

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 27th Feb 2003 02:14
Not really... just being allocated that way.
Notice the difference in CPU when you switch Half-Life from DirectX -> OpenGL

personally never use Half-Life in DirectX because it so poorly coded, i can't stand that bloody jitter movement of the cam as the Render loop waits for the program loop to catch up.

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
rapscaLLion
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 27th Feb 2003 04:25
lol I don't notice any jittery movement. I guess my eye isn't as trained as yours...

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
rapscaLLion
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 27th Feb 2003 04:26
or maybe my computer is just so slow that the render loop and the program loop are in sync

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 27th Feb 2003 04:46
cant u find the capslock button?

Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 27th Feb 2003 07:29
i guess some people are more used it or something... i've always noticed it, not just cause i've got a trained eye or anything - i notice when games slow in FPS, i notice when games do that jumpy movement thing.
Yet hardly anyone else sees it - my bro got Theme Park World for the PSone the otherday, and when you have more than 3-4rides the game starts flopping on the FPS BADLY, but he can't see it. Drives me more nuts i think that alot of people don't notice it, than it is actually happening

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Galiem
22
Years of Service
User Offline
Joined: 27th Nov 2002
Location: United States
Posted: 27th Feb 2003 17:38
Is it possible, perhaps, to specify the priority the app gets in CPU time?

Take a look at the settings in Winamp, for example, if you're not sure what I mean. Thread priority for CPU time may be set at a level that is tailored more for the user.

I have DB, but not DBPro yet (getting it on the 15th finally), so I couldn't tell you the exact code.

Basically, your code telling your app to go to windowed mode should have its own function. That function may be bookmarked, and refered back to at the point which the app should go windowed.

In that function, integrate code to set the CPU priority to medium, instead of high (to describe it simply, instead of with numbers, but in code it will be done with numbers). Basically, when in high, the app would completely take over the CPU, leaving no processor time for other apps. This may be fine when full screen. However, once windowed, it should go medium, so it only takes what isn't used by other apps. This will keep your CPU at 100%, but will ration the CPU time among active processes.

If the program is minimized, you may want it to either pause (good idea for games), or switch to low priority. With low priority, the app would only take what it needs to stay opened, and any other app may take CPU time over it. If the app is, say, a world editor, and not a game, this may be a bad idea. Reason being that a user may want to minimize the app while it is running a process. A good example would be, say, "compiling" the world by taking all changes made by user and moving them from buffer files to the actual files they're saved in permanently. The user may want to do other things while the world "compiles", but you wouldn't want that process to be slowed down so much that it takes an eon to complete.

I don't really know if DBPro supports CPU priority specifications natively, however, thee should be a DLL or two available out there to do the trick (if you can afford to shell out the cash for one).

By the way, consider me an advanced noob lol. I know and understand most of the theories regarding coding, but don't know the actual code that well yet... Am still learning. Expect to see some complex questions from me on this board in times to come.

Since I look to the forums for help myself, I will share things I come across to help others. Likewise, if you know of a DLL which allows you to do the trick described here, then please share 8) Heck, since Winamp is open source, and it has an in-app procedure for doing this, I would imagine there's a resource or two there 8)

MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 27th Feb 2003 18:09
You can specify priority - especially with XP, if you have something along the lines of X-Teq.

No idea what would happen, as I haven't tried doing it yet.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Galiem
22
Years of Service
User Offline
Joined: 27th Nov 2002
Location: United States
Posted: 27th Feb 2003 19:59
Specifying CPU priority can be dangerous, if not done carefully. Mos programs run at medium by default. Also, the process to choose and set priority most definitely varies with each version of Windows, so it is probably a huge compatibility headache when making release level software.

The reason it's so dangerous is because if something has low priority, it ma not even run on some systems. This is simply because everything else running has high priority or medium, and simply don't let it.

If set on high priority, the program could muscle out processes needed for system stability or security, which can't always be on high.

Most companies use the full high priority at full screen, low priority at minimize, no windowed mode at release. Then, once they have more data after so much time on the market, they release a patch allowing regular windowed mode. It can be very tricky.

If you're trying to build an app to be used as a regular windows program, unrelated to games, keep medium priority. Not to knowck DB at all, but there are much better languages out there for that type of program.. C++ is my favorite, because it is custom tailored for Windows, and indeed, was even used to write much of every version of Windows.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Feb 2003 20:03
This is not a priority thing. DBPro apps run at 'normal' priority within windows.

For the technical, what DBPro does is instead of using GetMessage inside the windows message pump, it is using PeekMessage. This means that instead of waiting for windows messages to appear if there are no new ones available, DBPro is checking for messages, and if there are none, continuing with processing.

DBPro is not designed to 'play nicely' with other apps. It is designed to grab all available processing resources to keep your frame-rate up.
Galiem
22
Years of Service
User Offline
Joined: 27th Nov 2002
Location: United States
Posted: 27th Feb 2003 22:39
Curious... Do properties of the language, such as this, bleed through into the programs made from it? IE Will my programs run in the same manner? Probably a stupid question, but curious anyhow 8)

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Feb 2003 00:42
In this case, yes ... because DBPro produces the 'message pump' loop automatically for you, and you (currently) have no say over what it puts inside this loop.
Terabyte
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 4th Mar 2003 15:47
OI! YOU NAFF OFF
IF I WANT TO WRITE IN CAPS LOCK I WILL
I DON'T SEE WHAT IS WRONG WITH TYPING IN CAPS LOCK
I DON'T MEAN ANY OFFENCE WHEN I DO THIS
IT JUST HAPPENS THAT I HAVE BEEN WRITTING IN DBPRO AND I LIKE MY SORCE CODE IN CAPS LOCK. I THEN SWITCH TO THE INTERNET TO ASK A QUESTION AND FORGET TO TURN OFF CAPS LOCK SO DON'T HAVE A GO AT ME! (i don't know the symbol for MSN angry Face so her goes it should be one of these...
[img](6) [/img][img](6( [/img][img][/img] [img])/img]

I have a word of advice...
..don't piss on an electric fence!
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 4th Mar 2003 16:22
Turn off caps lock or I'll remove your posts.

Is that a better incentive?

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 4th Mar 2003 18:10
"OI! YOU NAFF OFF
IF I WANT TO WRITE IN CAPS LOCK I WILL
I DON'T SEE WHAT IS WRONG WITH TYPING IN CAPS LOCK
I DON'T MEAN ANY OFFENCE WHEN I DO THIS"

It means that you are "shouting", which is offensive.

Current Project: Retro Compo. Entry.
Terabyte
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 6th Mar 2003 13:37
hey! is said no offence. that means i meant no offence
and also, this post seems to have gone off the point
originaly i asked can't dbpro be more efficient in its use of the cpu. Iam not critisizing dbpro in any way in fact i think it's brilliant. but i don't see why you should remove my posts just cus i'm usign caps. that xxxpertaxx mentioned a word of abuse -bloody i don't see his posts being removed
[img][/img]

I have a word of advice...
..don't piss on an electric fence!
rapscaLLion
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 6th Mar 2003 14:41
When caps is on, people read it as if you are shouting. And when you are talking about DBP at the same time it sounds like you are putting it down. If you forget you are typing in caps, just say so at the end so people know you aren't shouting

BTW-Bloody isn't a terribly offensive word to most people, so petrat's post wasn't removed.

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
Lee Bamber
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location:
Posted: 7th Mar 2003 00:28
Although the thread lost me somewhere in the middle, to address the original concern Patch 4 will have the new ability for applications that require processor friendly operation to use the SYNC OFF (default state) when you wish your application to 'play nicely' with the other windows. Naturally you want red-hot processor magnet mode when running 3D as fast as you can get, but now you have the option (for your menus for example) to switch to a mode where the DBPro app will consume only 1-2% of the CPU overall processor time.

Terabyte
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 11th Mar 2003 15:49
thanks lee
[img][/img]
just one question. are you the same lee bamber who wrote programs for The Micro User?

I have a word of advice...
..don't piss on an electric fence!

Login to post a reply

Server time is: 2025-05-19 01:40:26
Your offset time is: 2025-05-19 01:40:26