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 / I am Having trouble wrapping my head around Multi-tasking

Author
Message
Maverick
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 13th Oct 2002 10:01
Is there any tutorials or some sample code that I could look at in order to get a better understanding of how to Make one thing do something while another is. Its probably simple, but its giving me a headache

Thanks greatly
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 13th Oct 2002 11:11
I dont think u can really perform true threading in DB or DBP, the internals of the compiler would have those features tho at a later optimised stage.



Imagine 2 strings with knots in them side by side.
each knot is a command and each length of string is a thread of code.

instead of the computer engaging one instruction on one string it performs 2 instructions, 1 on each string at the same time.

Mike mentiones hyper threading which is another level up again it seems with multiple cpus and cpus that can have more than one pipeline.

google
has heaps of info and a good directory
http://www.google.com/search?num=30&hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8&safe=off&q=multithreading&spell=1

http://directory.google.com/Top/Computers/Programming/Threads/?tc=1

http://www.lunarpixel.com/ is my new site
Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 13th Oct 2002 19:17
You need a computer with at least 2 CPUs to truly do more than one thing at once. Normal multitasking is just the CPU switching between each thread rapidly (offset the two strings so that the knots on one line up with the spaces on the other).

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 14th Oct 2002 06:09
not with new generation cpus it appears. they can handle 2 instructions at once and this will porlly grow n grow.

http://www.lunarpixel.com/ is my new site
Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 14th Oct 2002 10:29
They have to be 2 completely different instructions, or else they try to use the same areas of the CPU and muck each other up. There's a prediction unit that is supposed to determine this and when it fails, the CPU dumps everything and reloads the instructions one at a time. The main difference in performance between the AMD Athlon XP and the Pentium 4 is caused by the fact that the Pentium 4 goes through twice as many sections of the CPU with each command - and it has twice as many sections as the Athlon - but it's prediction unit fails more, so it has to redo instructions twice as much as the Athlon, lowering its effective speed. And just to clarify things a bit more, the Pentium 4 has twice as many sections as the Athlon, but they're smaller than the sections in the Athlon. The CPUs are about equivalent in capabilities.

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM

Login to post a reply

Server time is: 2024-04-25 18:10:41
Your offset time is: 2024-04-25 18:10:41