[MUD-Dev] Re: lurker emerges
T. Alexander Popiel
popiel at snugharbor.com
Sun Aug 9 15:32:33 CEST 1998
In message: <13773.64266.876212.231468 at arioch.tky.hut.fi>
Petri Virkkula <pvirkkul at iki.fi> writes:
>>>>>> "Chris" == Chris Gray <cg at ami-cg.GraySage.Edmonton.AB.CA> writes:
>
>Chris> In general, I think its clear that threading will only actually
>Chris> increase your speed if your system has multiple CPUs.
>
> That's only true if your program is CPU bound. If the program
> is I/O bound then count of physical disks is more relevaant
> factor. In a mixed case I would use (this is only a guess)
> x+2*y as formula for optimal thread count (x is count of CPUs
> and y is count of physical disks), count of physical disks are
> multiplied with 2 to keep disks busy all the time.
*blink blink*
You seem to assume that it is impossible for a single thread to keep
even one I/O device continuously busy. Whatever happened to double-
buffering and non-blocking I/O? Has that art actually been lost in
the annals of time?
>Chris> Threading has overhead over non-threading, and there isn't
>Chris> anything you can do about that.
>
> Don't forget that non-threading has overhead too: if there is
> multiple file descriptors then select'ing and going through
> fd_sets can burns CPU time too.
While this is true, this overhead is something that a creative
programmer can manage and reduce, while the overhead of multiple
threads is untouchably bound in the OS kernel.
I prefer problems that I have at least some hope of fixing.
- Alex
More information about the mud-dev-archive
mailing list