Improved multiprocessor usage on amd64
Stephen Montgomery-Smith
stephen at math.missouri.edu
Tue Sep 16 00:36:14 UTC 2008
Martin Cracauer wrote:
> Stephen Montgomery-Smith wrote on Sun, Sep 14, 2008 at 08:38:00PM -0500:
>> I have a dual core amd64 on which I run a processor intensive numerical
>> program. I had been frustrated because it seemed to run 3 or 4 times
>> faster under Linux. But with a recent upgrade of FreeBSD-CURRENT, it
>> now goes at about the same speed as Linux.
>
> Are the threads meant to provide additional CPU resources or help with
> concurrency/IO issues?
They are meant to provide additional CPU resources.
>
> Do you create a lot of new threads on the fly?
>
No. They are synchronized via standard pthread_cond type constructions...
> What kind of worker model do you have there?
>
... and each thread is a loop of the form
while (1) {
wait until told to start;
do massive amounts of floating point arithmetic (only additions and
multiplications) on large arrays;
tell the master process that you are done;
}
> Do you have about as many threads as processor or more?
Both ways. The time difference between the two approaches is negligible.
>
> How malloc intensive is it?
All mallocs are done one time at the beginning.
>
> Martin
More information about the freebsd-current
mailing list