I want to play around with threading and parallelism.  I know my processor has multiple cores, but do not know how to see what is happening on each of them.  What is the right way to access this information?More concretely, I am planning the following:I imagine writing a little program that launches several threads, these threads should then be spread over the cores and communicate with each other where needed.  I would like to be able to observe where which thread is running, any hints?I am completely new to trying this kind of thing (I would also be quite happy with any information related to this that does not directly address this question).Best,Bart(googling only got me to cat /proc/cpuinfo, which seems to tell me I have 7 processors.  This is not a true fact, which tells me I do not know how to read this output.)
Processor use and core use
linux;development
Number of processors: Please note that numbering starts from 0 so if I have processor 1 I have at least 2 of themBounding to threads Threads will not be bound to CPU's (unless you do tricks by using cpulimit & co. - in most cases you shouldn't). Assuming that you have configured kernel with 1000Hz and there is no I/O the context switch is done 1000 times per second. Now in my 2 Processors setup I have around 300 threads running at this moment which means that 6.(6) slots will be allocated per process. It is safe to assume that in any second each process will occupy the both core.Given - the staircase algorithms, I/O make it not necessary true but each thread at one second may be on both cores - as well as running nowhere as it is waiting (so it is not bounded to any core).Hyperthreading I guess that you have 4 core Intel iX with hyperthreading (unless you have dual processor machine). Hyperthreading works by emulating a separate core. So if process is waiting on one core for I/O it can switch to executing another - which of course complicate matter further.