[Top][All Lists]

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

Re: how to enable thread

From: Linda Walsh
Subject: Re: how to enable thread
Date: Thu, 04 Aug 2011 06:43:52 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/20100228 Thunderbird/ Mnenhy/

a make -j will automatically try to schedule tasks on different cpu's if they are needed. Perhaps your job's weren't sufficiently long, or you didn't specify the makefile to be
done in parallel.

but try this:

for i in {0..7};do
(for ((j=0;j<10**6;++j)) {a=$j})&

That will run 8 loops of a million loops each in background, you should see
all your cores busy then...   if a million loops exit too quickly make the
6 a 7, (i.e. 10 million loops...etc)...

If they still don't run in parallel,
get 'sysinternals process explorer', and make sure in your parent process isn't limited
to 1 cpu...(i.e. cpu affinity != all cpus)...

lina wrote:

I can see when I tried to make -j 8, my 8 cores can be fully occupied.

I wrote a short bash script to run something, but only one core was used.

are there some simple way to enable thread in my bash script.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]