[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Threads



Steve Baker wrote:

> On multiple CPU's, threads are OK (so long as your granularity is
> OK) - but then you'll probably want your code to run nicely on
> single CPU machines - and if it does, it's simplest to just ignore
> the second CPU rather than write two versions of the code - one for
> uniprocessor and another for SMP.

Even with multiple CPU, you have to be ultra-careful not to read or
write to memory used by other threads. If you have to be so careful, why
then not simply normal processes with some form of shared memory (SysV
or mmap)? Ralf Engelshall has this nifty malloc-like library that gives
you a "shared malloc" in addition to the regular one, so you can share
only what you need, the rest stays private.

-- 
"I've run DOOM more in the last few days than I have the last few
months. I just love debugging ;-)" -- Linus Torvalds

---------------------------------------------------------------------
To unsubscribe, e-mail: linuxgames-unsubscribe@sunsite.auc.dk
For additional commands, e-mail: linuxgames-help@sunsite.auc.dk