Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 12 of 12
for OS's, unless you do hardcore assemby programming you probobly dont directly interact with the proccesor, you just write code. multicore programs are progrmas that are written to use more ...
  1. #11
    Linux User benjamin20's Avatar
    Join Date
    Oct 2004
    Location
    jacksonville beach FL
    Posts
    317
    for OS's, unless you do hardcore assemby programming you probobly dont directly interact with the proccesor, you just write code. multicore programs are progrmas that are written to use more than one executing thread at a time. you can do this by starting up multiple proccesses or the more common method of starting multiple threads. you use a thread library that takes care of the intracacies of it fore you.

    with c/c++ you can either use the os suplied proccess livraries, which i have never used but do understand the concept. im shure some of you have heard of "fork()" before. with threads in c/c++, which i have worked with before, you create a new thread by first writing a function that takes a void* argument (if you dont know what that is and you realy want to know you will have to research it) and then passing that function into a thread creation function in the pthreads library.

    the way it works is behind the scenes there is a thread schedular, you know this as "multitasking" and its job is to decide when to switch executing threads(includes processes to, since proccesses are like threads but a little more bloated[but more independent]). when a switch occures it first waits to the end of a critical point and then gets the next thread in line to get a turn and starts it up. with more than one proccessor there is multiple threads executing, each has a time limit, when either decides to switch they just pull the next thread to go. the thread that just went just gets in the back of the line for its next turn. this can happen several hundred times a second at least. giving the apperence of infinite executing cores.

    multiple cores make the threads go through faster, but one thread cant be in both ccores at the same time. so this is why heavy progrmas need to be multithreaded to get the benifite of multiple core. for small programs its still beifitial because it is equivelent to system proccesses and doesnt need a lot of time or power, but heavy threads are only geting the power of one core at a time, shure system proccesses arent effecting it nearly as much as they are on single core systems since the big proccess can be in one core while the system proccesses are in the other. this is why its important to break it down into seperate threads so that both cores can bear the load.

    almost everything with multiple cores use this time slycing method. the ps3 however will be enphesizing a mothod where games will dedicate a core to a job. this gets rid of overhead costs of the timeslicing method. normaly this would be a bad idea, but since you will only be running the game and there are 7 availible cores, if done right you can get more power behind the game if you can make shure to give each core equal jobs.
    nVidia G-Force 6600GT (bfg) pci-e: amd 64 2000+ (939): 1024 corsair ram: 2X 80gb seagate harddisk SATA: plextor cd/dvd-read/write cdrom SATA

  2. #12
    Trusted Penguin Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,391
    Quote Originally Posted by Juan Pablo
    Roxoff: I mean, how can I send a process to a specific core?
    Lol, I dont know. Personally, I think it's far too much dicking around trying to force your service to run on one, and one only, of the available cpu's. You'd need schedulers that prevented other things butting-in on that particular cpu core. You also build in problems if you try to keep a certain cpu for just certain tasks - if those tasks are quite lightweight and the other three processors on the server are flat-out trying to keep up with user-space applications, then you're effectively denying the paying customer of up to 25% of his computer power.
    Linux user #126863 - see http://linuxcounter.net/

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •