You are not logged in.

#1 2009-03-05 13:54:32

Convergence
Member
Registered: 2005-07-02
Posts: 377

question about SMP

Everything I read about multi-core processors tells me that it is almost pointless to get one.  I'm constantly reading that the vast majority of software is designed in a way that it is only capable of utilizing one core at a time.  In fact, I was surprised that anybody was buying these things.  Then a question occurred to me:

What if the kernel can actually allocate different processes to different cores?

Is that the case?  Let's say that I'm encoding a huge video, and simultaneously playing a cpu intensive game.  Now both of these processes are single threaded, but can the kernel delegate them to different cores?  If so, then all of those disclaimers that multi-core processors are over rated are... overstated

Furthermore, every once in a while (at least on my computer), a process goes wild and eats up %100 CPU.  When this happens, sometimes it seems impossible kill the process, because stopping the process would require some cpu time, and there is none available. If linux is capable of divvying up different processes to different cores, then wouldn't this be impossible? (assuming that the run-away process is single threaded)  In that case, wouldn't multi-threaded processes cause a minor threat to system stability?


It's a very deadly weapon to know what you're doing
---  William Murderface

Offline

#2 2009-03-05 14:23:30

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: question about SMP

Yes, Linux is _that_ awesome.

edit: Windows too, but I think that wasn't your question.

Last edited by byte (2009-03-05 14:25:03)


1000

Offline

#3 2009-03-05 14:29:08

jelly
Administrator
From: /dev/null
Registered: 2008-06-10
Posts: 714

Re: question about SMP

It is too developpers to make programs completely multiproc. but the kernel takes advantage of multiple proccessors, we are buying this processors because the simply make your system far more faster than single core. I am not fully aware of what linux exactly does with the cores but i think it just dynamicly spreads the load to all of the 2 (4) processors.

Convergence: just google about this question it is very specific. the kerneltrap.org might be a good site for info

Your second point about that process going wild, i have never had such thing with multicores and they arent making the system unstable. Well i have had somethimes a 100% cpu usage because of a infinite while loop smile

Offline

#4 2009-03-05 21:37:05

Convergence
Member
Registered: 2005-07-02
Posts: 377

Re: question about SMP

Thanks guys. 

byte: exactly the answer I was looking for.  Even the windows part was helpful.

jelly:  I knew that multicore systems were in theory much faster than single core processors, but reading what editors have said about muticore systems, I'm pretty sure that most of the time, only one core is being utilized.  I'm pretty sure that if you run one very cpu intensive program (that isn't multi-threaded) and watch htop's output, you'll see that it is using just one core at a time.  Therefore, your system might as well be single cored, because you are not really utilizing all the cores for that process.  (at least according to magazine and internet hardware reviews) 

So as an experiment, you could compile a simple program with an infinite loop, execute it and watch htop's output  (or you can just encode a movie or something with software that you know is single threaded (I think that almost all software is still).  I think that it will max out just one of your cpu's.  It shouldn't max out all 4 cpus (for some reason I assumed that you have four cores) because it is single threaded, and I don't think that it is possible to spread a single thread across multiple cores. 

Well, this is the kind of experiment that I would be doing if I had a multi-core system, and I don't expect you guys to just sit around satisfying my curiosity, but if someone is just as curious as I am, and you don't mind posting your findings, I would love to read them. smile  If not, until then, I'll just have to wait until I get one for myself.


It's a very deadly weapon to know what you're doing
---  William Murderface

Offline

#5 2009-03-05 21:48:35

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: question about SMP

You can even set the CPU affinity so you can control the use of your cores wink
http://www.cyberciti.biz/tips/setting-p … ocess.html

Last edited by fukawi2 (2009-03-05 21:48:53)

Offline

#6 2009-03-05 22:24:10

Ronin-Sage
Member
Registered: 2008-10-24
Posts: 153
Website

Re: question about SMP

I always thought of multi-core systems as being more flexible, not faster, than single-core systems. I would imagine it's like two jugglers--a single one can't juggle more than three balls, so it's capped there, but add another juggler and you have the ability to juggle 6 balls at the same time, but the jugglers can't "aid" each other in a direct manner.

Offline

#7 2009-03-05 23:26:48

Convergence
Member
Registered: 2005-07-02
Posts: 377

Re: question about SMP

fukawai2:  hah!  that is awesome. Can't think of any practical reasons for it, but I like it.


It's a very deadly weapon to know what you're doing
---  William Murderface

Offline

#8 2009-03-06 11:29:12

esh
Member
Registered: 2008-11-05
Posts: 28

Re: question about SMP

If you have any specific tests I have an 8 CPU machine on Arch here. You are right, one single-threaded program that runs an infinite loop will max one core at most. Linux does occasionally shift programs between cores as it sees fit though. Video encoding and 3D rendering will chew them all up happily, however.

Offline

#9 2009-03-07 09:08:24

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: question about SMP

Convergence wrote:

fukawai2:  hah!  that is awesome. Can't think of any practical reasons for it, but I like it.

If the kernel makes poor choices about how to balance specific processes between the cores/CPU's then you can override with some human intellect.

Offline

#10 2009-03-07 23:54:03

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,544

Re: question about SMP

I have a quad-core and love it big_smile When I used Windows on a single-core, it would bog down a lot. With the quad, it's actually smooth (Linux never had such problems wink).

More and more things are optimized for multi-core, and the situation will only improve. A good example of multi-core power is x264. It scales linearly up to 8/16 cores, I forget which. A quad-core will be 4x faster than an otherwise equal single-core. Xvid's SMP code isn't as good, but there's still a very appreciable increase.

Look at the demanding things you run on your PC - I'll bet the majority are either games which have the GPU as bottleneck, or are multithreaded. Linux has even more multithreaded apps than Windows.

Offline

#11 2009-03-08 11:00:23

Convergence
Member
Registered: 2005-07-02
Posts: 377

Re: question about SMP

esh wrote:

If you have any specific tests I have an 8 CPU machine on Arch here. You are right, one single-threaded program that runs an infinite loop will max one core at most. Linux does occasionally shift programs between cores as it sees fit though. Video encoding and 3D rendering will chew them all up happily, however.

I love this forum.  I don't actually know anyone in person that shares my computer interests.

You say that 3d rendering uses up all the different cores, does this only apply to newer apps that have multithreading?  When I run NWN it eats up 100% cpu even though my computer is substantially faster than the recommended system specs for the game.  Someone told me that it was because my GPU is much more powerful than my CPU (nvidia 7600 vs my old athlon 2400+), so my GPU constantly demands more from the CPU so that it can render more frames.  Anyway (I don't know if you have any older games that could satisfy this question) would you expect for similar games to utilize more than one CPU?  (maybe opengl has something to facilitate utilizing multiple cores for rendering 3d even in single threaded programs).


It's a very deadly weapon to know what you're doing
---  William Murderface

Offline

#12 2009-03-14 07:55:04

evilgold
Member
Registered: 2008-10-30
Posts: 120

Re: question about SMP

Newer dual and quad core CPUs are a BIT over rated, but they do have some advantages over single core equivlents. I currently have a Celeron 430 in my desktop. Its essentially the same core as a core 2 duo, but without the extra core.

As for your issue with NWN. I dont have that game specifically, but i do have a similar issue on my single core system wotj something like WarCraft III , or even really simple games like chalk. It doesnt seem to slow down how my system feels though.I can usually keep a web browser open on my second monitor and go back and forth with minimal lag, even on newer games like Red Alert 3.

Offline

Board footer

Powered by FluxBB