flat assembler
Message board for the users of flat assembler.

Index > Windows > Dual Core Coding !?

Author
Thread Post new topic Reply to topic
Kuemmel



Joined: 30 Jan 2006
Posts: 200
Location: Stuttgart, Germany
Kuemmel 23 Mar 2006, 13:29
Hi there,

I would like to 'pimp' my fractal/mandelbrot code for Windows with the proper use of a dual core processor, as this would be a pretty good application. It can be calculated perfectly in parallel way...has anyone ever done some coding for a dual core ? Or even a tutorial ? Or is there any basic problem doing this with FASM ?
Post 23 Mar 2006, 13:29
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 23 Mar 2006, 15:04
Have you tried using two threads?
Post 23 Mar 2006, 15:04
View user's profile Send private message Reply with quote
Kuemmel



Joined: 30 Jan 2006
Posts: 200
Location: Stuttgart, Germany
Kuemmel 23 Mar 2006, 20:18
locodelassembly wrote:
Have you tried using two threads?


Actually I'm quite new to Windows / x86 programming and I just focused on simple single task code...so what you are saying, is that setting two threads could work this out ?

Is there any decent example for thread programming ?
What about the register set up of a dual core machine ? Can each core have it's on registers or is that totally managed on the core ?

Sorry for the confusion...may be this has been addressed before and I didn't manage to find something while searching the board.
Post 23 Mar 2006, 20:18
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 23 Mar 2006, 20:40
Kuemmel, if your Windows supports that Dual-Core processor you only need to make your application multi-threaded. Is responsability of the operating system dispatching threads for execution on both cores and only one thread can be executed in a core at a time.

Sorry, I haven't got any link to threading in assembly, all I can tell you is search in MSDN CreateThread and things related. Maybe someone have links?

Regards
Post 23 Mar 2006, 20:40
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 24 Mar 2006, 08:20
Only making 2 threads won't help. You need to tell these threads what to do. I suggest making one thread go from the beginning and the other from the end if that is possible and check some flag if they met in the middle and you're done Very Happy
Post 24 Mar 2006, 08:20
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Kuemmel



Joined: 30 Jan 2006
Posts: 200
Location: Stuttgart, Germany
Kuemmel 24 Mar 2006, 12:36
@locodelassembly: Thanks for the MSDN CreateThread proposal, I check that one out

@Madis731: That was my plan more or less. Having two threads, one will calculate the upper half of the fractal on the screen, the other the lower one. I'm just wondering how these two threads will share data or register, etc. For sure it's better when they both have their own local data to limit whatever kind of existing memory or register access penalties in the pipelines...got to read more about this architecture anyway I think...

Anybody else some Threading-Example with FASM ?
Post 24 Mar 2006, 12:36
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 24 Mar 2006, 14:26
Well I'm blind for sure, I visited iczelion page yesterday and I didn't find it, but now http://win32assembly.online.fr/tut15.html . "Tutorial 15: Multithreading Programming" very clear but my eyes didn't read that yesterday...

Well it's MASM but it's not hard to convert to FASM.

Hope it helps you

Regards
Post 24 Mar 2006, 14:26
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 24 Mar 2006, 18:26
Here's some simple examples of multi-threading in Fasm, You'll have to put my TurboAsmDx.dll in your "C:\WINDOWS\SYSTEM32" folder. Also, you'll need to go to my website http://users.egl.net/talktomatt/default.html and download my include directory and replace the stadard one that comes with Fasm so you can recompile them.
Post 24 Mar 2006, 18:26
View user's profile Send private message 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.