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.

Work in Progress / Testing threads in DBPro

Author
Message
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 9th Jan 2007 15:56 Edited at: 14th Jan 2007 16:00
The STYX plug-in provides intervals, that means DBPro will automatically call given functions at given intervals. In STYX version 1.10 these intervals can optionally run independently from the main program (in its own thread). So you can do stuff in the background while the main program runs as usual.

The attached executable calculates 2 x 5000000 square roots (that might take several seconds). The first part does both calculations after each other, the second part calculates them "at the same time".


Please try and post your results (and what CPU type you have).

empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 10th Jan 2007 12:29
with intervals i got: 2935
without intervals i got: 2994
my processor is a: Mobile Intel(R) Pentium(R) 4 CPU 2.80GHz 1.59GHz
(don't know why it gives me two processor speeds there but ahwell)

empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 10th Jan 2007 20:32
Thanks, Lukas.

As long as Intervals are not slower than the standard approach I'm happy.

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 10th Jan 2007 20:57
What exactly is this? Sounds almost like the multi threading plugin I made a while ago.

empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 10th Jan 2007 21:00 Edited at: 10th Jan 2007 21:04
Yes, it introduces threading capabilities to the already available "Interval" command set of the STYX plugin.

It does use a different approach from yours to obtain the function addresses, though.

John Y
Synergy Editor Developer
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: UK
Posted: 10th Jan 2007 21:11
What sort of things can be multi threaded, just mathematical expressions, or object loading etc?

Get the new DarkBasic Professional IDE for only $19.99/~£9.85
Http://synergyide.thegamecreators.com
Http://www.digitalzenith.net
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 10th Jan 2007 21:22
without: 2035
with: 1617
Processor 1: x86 Family 6 Model 14 Stepping 8 GenuineIntel ~1828 Mhz
Processor 2: x86 Family 6 Model 14 Stepping 8 GenuineIntel ~1828 Mhz

That's pretty neat you found another way to grab functions!

Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 10th Jan 2007 21:35
without : 2938
with : 1906

Great job, with this I could finally take advantage of my hyper-threading processor

empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 10th Jan 2007 21:51
Thanks for testing

JohnY:
Quote: "What sort of things can be multi threaded, just mathematical expressions, or object loading etc?"

That's what we're currently trying to find out. As you'd expect, you can't do any rendering operations in threads.


Torrey:
Quote: "That's pretty neat you found another way to grab functions!"

Yes, I only know of those two ways to get function addresses. Although I'm not sure which one I like more.


LIT:
Quote: "Great job, with this I could finally take advantage of my hyper-threading processor "

Thanks.

Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 10th Jan 2007 22:38 Edited at: 10th Jan 2007 22:41
without intervals: 3447
with intervals: 2201

(Pentium 4 HyperThreading 3.0Ghz)

I'm assuming that number is the time it took, so smaller is better right?

[edit] it looks like Lucas W was using a processor that doesn't have Hyper Threading, because the difference was so small... that's nice that it didn't run slowly on his.

One man, one lawnmower, plenty of angry groundhogs.
valleyman86
17
Years of Service
User Offline
Joined: 15th Dec 2006
Location:
Posted: 10th Jan 2007 22:55
without intervals: 2219
with intervals: 1438

Is this a multithread test?
Dj Thunder
18
Years of Service
User Offline
Joined: 28th Jun 2006
Location: France
Posted: 10th Jan 2007 23:03
without intervals: 2184
with intervals: 2184

AMD Athlon64 3500+

Hardcore Will Naver Die !
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 10th Jan 2007 23:09
Thanks.


PeterH:
Quote: "I'm assuming that number is the time it took, so smaller is better right?"

Exactly!


valleyman86
Quote: "Is this a multithread test?"

Yes, it is.

tiresius
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 11th Jan 2007 01:35
Sorry to be a stick in the mud, here are my numbers.

Without: 4140
With: 4235

Did it again and got similar results, 4110/4234.


Dell DIMENSION DIM4550
Intel(R) Pentium(R) 4 CPU 2.00GHz
1.99 GHz, 1.00 GB of RAM

I'm not a real programmer but I play one with DBPro!
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Jan 2007 02:25
1st try: 3078/3078.
2nd try: 3078/3093.

AMD Athlon 64 X2 5000+ (2.6Ghz).

Quote: "It does use a different approach from yours to obtain the function addresses, though."

Could you possibly shed some light on how you did it?

Tempest - P2P UDP Multiplayer Plugin (DBP/DBCe)
Download the free version
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 11th Jan 2007 02:58 Edited at: 11th Jan 2007 02:59
tiresius:
That's a good result. It heavily depends on what else is running. Plus there's a little safety code overhead with intervals.


Benjamin:
Yes. Basically it uses a TPC command that simply obtains the ret (return) address so that you've got a rough idea where in memory you are. Depending on where this command is located, you can do several calculations to grab a function address. Most of those calculations turned out to be rather unsafe, though.

dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 11th Jan 2007 08:01
2150/1338

Seems a little slow to be 1337 , but that's pretty cool, I have a AMD Athlon 64 X2 4400+

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Jan 2007 09:49
Quote: "Yes. Basically it uses a TPC command that simply obtains the ret (return) address so that you've got a rough idea where in memory you are."

Ah right, that makes sense. I'm guessing it's not quite as easy as it sounds..

Tempest - P2P UDP Multiplayer Plugin (DBP/DBCe)
Download the free version
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 11th Jan 2007 12:15
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 11th Jan 2007 12:19
Quote: "Don't you better things to do ? "

Yes. Lots of them even.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 12th Jan 2007 01:15
Without intervals: 2047
With intervals: 2047

My system specs:
Microsoft Windows XP, Media Center Edition
Version 2002, Service Pack 2

HP Pavilon
AMD Athlon 64 Processor 3800+, 2.39GHz, 960MB RAM

-db

GameDeveloper, make your own games with a drag-and-drop interface. Basically t3dgm+fpsc editor combined.
http://forum.thegamecreators.com/?m=forum_view&t=86045&b=8&p=2

Login to post a reply

Server time is: 2024-11-23 21:41:09
Your offset time is: 2024-11-23 21:41:09