On 20.02.2005, at 22:55, Sven Neumann wrote:

Since gthread is just a very thin wrapper around pthreads, that would
mean that it's a stupid pthread implementation. To me this looks like
the kernel believes that it would be better to keep the threads local
than to move one to the other CPU. I wonder if perhaps the kernel is
right and using two CPUs would actually cause more overhead than it's
worth?

Hm, it is using NPTL, e.g. if I set it to 8 threads I'll have:
egger 31344 2.1 14.5 219412 149008 pts/0 Sl+ 23:10 0:05 /opt/gimp-mp-test/bin/gimp-2.3
egger 31344 10.8 14.5 219412 149012 pts/0 Rl+ 23:10 0:26 /opt/gimp-mp-test/bin/gimp-2.3
egger 31344 11.0 14.5 219412 149012 pts/0 Rl+ 23:10 0:26 /opt/gimp-mp-test/bin/gimp-2.3
egger 31344 6.5 14.5 219412 149012 pts/0 Rl+ 23:11 0:08 /opt/gimp-mp-test/bin/gimp-2.3
egger 31344 5.7 14.5 219412 149012 pts/0 Rl+ 23:11 0:07 /opt/gimp-mp-test/bin/gimp-2.3
egger 31344 6.8 14.5 219412 149016 pts/0 Rl+ 23:11 0:08 /opt/gimp-mp-test/bin/gimp-2.3
egger 31344 6.1 14.5 219412 149016 pts/0 Rl+ 23:11 0:08 /opt/gimp-mp-test/bin/gimp-2.3
egger 31344 6.8 14.5 219412 149016 pts/0 Rl+ 23:11 0:08 /opt/gimp-mp-test/bin/gimp-2.3
egger 31344 6.2 14.5 219412 149016 pts/0 Rl+ 23:11 0:08 /opt/gimp-mp-test/bin/gimp-2.3

If I force it back to classical pthreads then it'll be even
worse:
egger 31456 70.8 15.0 164232 154852 pts/0 R+ 23:32 1:53 /opt/gimp-mp-test/bin/gimp-2.3
egger 31457 0.0 15.0 164232 154852 pts/0 S+ 23:32 0:00 /opt/gimp-mp-test/bin/gimp-2.3
egger 31458 0.0 15.0 164232 154852 pts/0 S+ 23:32 0:00 /opt/gimp-mp-test/bin/gimp-2.3
egger 31459 0.0 15.0 164232 154852 pts/0 S+ 23:32 0:00 /opt/gimp-mp-test/bin/gimp-2.3

One interesting thing here certainly is that one process
(== thread) is doing all the work and the rest is doing
nothing in a shape fill, while in a linear fill I'll get:
egger 31474 3.4 10.8 120696 111508 pts/0 S+ 23:36 0:04 /opt/gimp-mp-test/bin/gimp-2.3
egger 31475 0.0 10.8 120696 111508 pts/0 S+ 23:36 0:00 /opt/gimp-mp-test/bin/gimp-2.3
egger 31476 35.1 10.8 120696 111508 pts/0 S+ 23:36 0:48 /opt/gimp-mp-test/bin/gimp-2.3
egger 31477 35.1 10.8 120696 111508 pts/0 S+ 23:36 0:48 /opt/gimp-mp-test/bin/gimp-2.3

However those are again running on the same CPU so
rather disturbing each other then crunching away.

To be continued...

Servus,
      Daniel

Attachment: PGP.sig
Description: This is a digitally signed message part



Reply via email to