[Stackless] stackless and multi-core

inhahe inhahe at gmail.com
Mon Apr 28 15:30:04 CEST 2008


ok, thanks. i thnk i understand, although it seems that if the os doesn't
assign one process per core then the extra processes are an arbitrary number
of which which will effectively deterimine how much overall cpu time the app
gets.  i.e. if you have 4 cores,  4 processes but they're not distributed
evenly it might as well have been 3 processes, 4 processes, 5 processes or 6
processes depending on how much cpu time you want.

i want to write a webserver, though, and i was thinking the webserver would
probably be i/o bound and not cpu bound (even if it gets lots of traffic),
so perhaps there's no reason to write it multi-core/multi-processor...?


On Sun, Apr 27, 2008 at 11:32 PM, Justin Tulloss <jmtulloss at gmail.com>
wrote:

> The scheduler doesn't really work like that. A process doesn't get
> assigned to a single core and then run to completion. The OS is
> actually switching between running processes every few milliseconds.
> If you start 2 processes, 1 may start on one processor and one may
> start on another, but after their timeslice is up, they may very well
> switch. For performance reasons, the OS will try to run a process on
> the same core that it was running on, but it's not necessary or
> guaranteed.
>
> The reason you would start 4 processes for 4 cores is that that's the
> maximum number of processes you can possibly have running at one time.
> However, everything else on your system is sharing in on that time.
> You might find that you get more CPU time if you double the number of
> processes, making it 2 per core.
>
> Justin
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20080428/5996a086/attachment.htm>


More information about the Stackless mailing list