|
From: Tom H. <to...@co...> - 2008-08-11 23:45:37
|
In message <a03...@ma...>
"Chris Packham" <jud...@gm...> wrote:
> I read http://valgrind.org/docs/manual/manual-core.html#manual-core.pthreadsand
> interpreted this as valgrind supplies its own pthreads.
>
> "Valgrind schedules your program's threads in a round-robin fashion, with
> all threads having equal priority." I guess this means even if it doesn't
> supply its own pthreads implementation it does alter the scheduling.
>
> I concluded, perhaps erroneously, that threading was causing my problems.
> What I'm really after is any guidance on running valgrind with a memory and
> CPU constrained environment.
No, what that is saying is that valgrind effectively overrides the
kernel's normal scheduling of the threads and forces them to execute
one at a time in round-robin fashion.
Valgrind does not (these days) replace libpthread, nor does it alter
the mapping between user and kernel threads. There is still one kernel
thread for each pthread you create - the only change is the order in
which they execute and how many may execute at once.
If your program is reliant on the order in which threads execute or how
many threads execute at once then it is, by definition, broken.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|