Dual and quad core assembler programming / O.S.

I've been exploring on assembler programming, and read a couple of articles on CPUs, but I can't find a tutorial or reference on quad and dual assembler. My question is:
What's the main difference between a normal processor and a dual or quad, when it comes down to assembler programming?

Thx,
Diego

P.S. I am playing around with this "make your own OS"  tutorials
LVL 1
d_iegoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ravenplCommented:
> What's the main difference between a normal processor and a dual or quad, when it comes down to assembler programming?
Nothing. Assembler has no idea about threads. You are coding single thread.
After all, C/C++ is the same - You are coding single thread - but if You know the code is to be thread safe, You have to code it that way.
Same with asm, if You want to make sure that the code is thread safe, You have to use bus/memory locking or atomic instructions.

Look at this case from CPU side - one core always runs single thread. It's the operating system who creates(on process request) new threads and processes and manages them.

> P.S. I am playing around with this "make your own OS"  tutorials
So basically what You need is to create threads scheduler. Initialize every available cpu/core with some OS thread(probably same entry point), which will then run the scheduler to assign userland threads/processes.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DropZoneCommented:
ravenpl's answer is correct and very informative.  However, I would like to expound on the threading topic.

As ravenpl said, in Assembly, and to the CPU in general, there is no concept of threads or processes; each core executes a single instruction at a time, and it is up to the software (e.g. the operating system) to divide and group the instructions on each tasks and feed them to each individual core or processor.

There are some very specific algorithms and techniques to do this, and all of them are fairly complex.  However, some processor manufacturers provide libraries or compilers that aid in making the various decisions required at the lowest levels of execution.

If you are using an Intel multi-core processor, you may want to look into the Intel TBB (Threading Building  Blocks) library:
    http://en.wikipedia.org/wiki/Threading_Building_Blocks

    -dZ.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.