flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
drobole 18 Nov 2010, 19:55
I have no idea what I am talking about so I'll make it short and sweet.
Can I utilize multiple cores using fasm? |
|||
![]() |
|
mindcooler 18 Nov 2010, 20:47
Short and sweet answer:
Yes. |
|||
![]() |
|
drobole 18 Nov 2010, 21:35
So can I control what instructions gets executed on each core?
|
|||
![]() |
|
mindcooler 18 Nov 2010, 21:38
Are you thinking... Windows? Real mode? Somehting else?
|
|||
![]() |
|
drobole 18 Nov 2010, 21:39
How about Linux/Windows, protected mode, user space?
|
|||
![]() |
|
drobole 18 Nov 2010, 22:18
Ok, so I'm basically in the hands of the OS threads then
|
|||
![]() |
|
mindcooler 18 Nov 2010, 22:23
If you're not going to run OS-less, yes.
|
|||
![]() |
|
Tyler 18 Nov 2010, 22:36
Have you ever made a mt program in another language? I would suggest it. If you have, then you are probably already familiar with a threading API. The APIs are the same as always. The most commonly used are WinAPI for Windows, and pthreads for *nix. With WinAPI, you can set the cpu affinity, but I don't know how strict it is, or if there s a Linux parallel.
|
|||
![]() |
|
drobole 18 Nov 2010, 23:53
Yea I'm familiar with those.
According to http://en.wikipedia.org/wiki/Processor_affinity Linux seems to have something similar. But as you said, it doesn't seem to be very strict, and I get the impression I'm better off leaving it to the OS scheduler to decide. |
|||
![]() |
|
Tyler 19 Nov 2010, 02:59
So you know how to use pthreads(or your threading lib of choice)? All you have to do from there is call them like you call libc(assuming you know how to import symbols), or anything else.
If you need help with threading using a specific lib, you'll probably want to go to a more relevant sub-forum to the thread lib's native OS. There's also lots of tutorials on threading in C, that are easy to understand in terms of how you could use the concepts presented, in assembly. |
|||
![]() |
|
Alphonso 19 Nov 2010, 12:49
drobole wrote: So can I control what instructions gets executed on each core? |
|||
![]() |
|
sinsi 19 Nov 2010, 13:03
Windows has SetThreadAffinityMask
|
|||
![]() |
|
drobole 19 Nov 2010, 17:09
@Tyler
I am familiar with using threads in C++. If I have any questions about using it in fasm I'll certainly be posting in the relevant OS forum ![]() The reason I wanned to know is basically that I consider writing a high level language compiler using fasm as the backend, and I was wondering about having builtin threading capabilities and possibly more fine grained control of execution. I guess thread affinity could come in handy as an advanced language feature. Thanks |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.