--- Hendrik Visage <hvjunk@xxxxxxxxx> wrote: > On 1/14/07, Henio Paszczak <blurrpp@xxxxxxxxx> > wrote: > > > Thanks .. but i want to turn secund core alive, > and i > > don't know how. For example how to write program > for > > two cores .. first core is summing integers from > memry > > locations mem0-mem1, second core does the same but > > with memory location (mem1+1)-mem2 ... , how to > load > > %eip register in second core and start it , and so > one > > .. :) > > Lukas > > Well yeah.... > > I'm going to explain from the Linux perspective > AFAIK, and you > can check the dmesg etc. output to confirm these. > > When the kernel starts up, it will startup on > (typically) CPU0 core0, ie. the > first available CPU/core, as the BIOS etc. does that > initialization, and since > it is single threaded only, only a single cpu/core > is "active" at that stage. > > The kernel then checks the ACPI (MPI??) and related > information to > see how many CPUs etc and then also checks the CPUs > to see their > capabilities. Once done (and SMP/HT/etc. is enabled > in the kernel) the > kernel will fire up and activae all those CPUs and > their cores. > > Check /proc/cpuinfo for the info the kernel knows > about. > > Then it's simple scheduling algorithms that the > kernel makes decisions to decide > which CPU/core gets which process that available to > execute. > > So, your program can't normally decide on which > CPU/core what gets executed as it's a decision done > by the kernel, and > the kernel > will also decide for how long your process will be > on that specific CPU/core. > > Thus fore multi CPU and/or multi-core systems, the > most generic (and > usefull way) > is to make use of threads/multiple processes and > make use of kernel > synchronization > methods to sync between the seperate > threads/processes. > > Okay, there are ways (given the Linux kernel > supports it like the > Solaris kernel does) > that you could request the kernel to keep your > process/thread on a > specific CPU/cpuset > for reasons related to better utilization of cache > data etc. > > -- > Hendrik Visage > Yes .. I understand that kernel is controlling that everything, but for sure there is some linux system call which give possibility to load secund core another thread, to synchronize this processes and so one. Any way .. some body had to write the kernel and give it "power" to decide which core to use ( of course i can read kernel source and for sure i will, but now i don't have enough time :) )... so for example i want to create binary file .. program which doing some computation on both cores, put it to diskette boot block and restart system. There is no linux and other os I can use only bios system calls etc. and there is for sure some method to take control over both cores. Lukas ____________________________________________________________________________________ Don't pick lemons. See all the new 2007 cars at Yahoo! Autos. http://autos.yahoo.com/new_cars.html - To unsubscribe from this list: send the line "unsubscribe linux-assembly" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
- Follow-Ups:
- Re: CPU cores...
- From: Hendrik Visage
- Re: CPU cores...
- References:
- CPU cores...
- From: Hendrik Visage
- CPU cores...
- Prev by Date: CPU cores...
- Next by Date: Re: CPU cores...
- Previous by thread: CPU cores...
- Next by thread: Re: CPU cores...
- Index(es):